REORG: include: move activity to haproxy/

This moves types/activity.h to haproxy/activity-t.h and
proto/activity.h to haproxy/activity.h.

The macros defining the bit field values for the profiling variable
were moved to the type file to be more future-proof.
This commit is contained in:
Willy Tarreau 2020-06-02 10:29:48 +02:00
parent c13ed53b12
commit a04ded58dc
14 changed files with 29 additions and 30 deletions

View File

@ -33,7 +33,7 @@
#include <haproxy/istbuf.h>
#include <haproxy/pool.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
/* an element of the <buffer_wq> list. It represents an object that need to
* acquire a buffer to continue its process. */

View File

@ -1,8 +1,8 @@
/*
* include/types/activity.h
* include/haproxy/activity-t.h
* This file contains structure declarations for activity measurements.
*
* Copyright (C) 2000-2018 Willy Tarreau - w@1wt.eu
* Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -19,12 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _TYPES_ACTIVITY_H
#define _TYPES_ACTIVITY_H
#ifndef _HAPROXY_ACTIVITY_T_H
#define _HAPROXY_ACTIVITY_T_H
#include <haproxy/api-t.h>
#include <haproxy/freq_ctr-t.h>
/* bit fields for the "profiling" global variable */
#define HA_PROF_TASKS_OFF 0x00000000 /* per-task CPU profiling forced disabled */
#define HA_PROF_TASKS_AUTO 0x00000001 /* per-task CPU profiling automatic */
#define HA_PROF_TASKS_ON 0x00000002 /* per-task CPU profiling forced enabled */
#define HA_PROF_TASKS_MASK 0x00000003 /* per-task CPU profiling mask */
/* per-thread activity reports. It's important that it's aligned on cache lines
* because some elements will be updated very often. Most counters are OK on
* 32-bit since this will be used during debugging sessions for troubleshooting
@ -65,7 +71,7 @@ struct activity {
char __end[0] __attribute__((aligned(64))); // align size to 64.
};
#endif /* _TYPES_ACTIVITY_H */
#endif /* _HAPROXY_ACTIVITY_T_H */
/*
* Local variables:

View File

@ -1,8 +1,8 @@
/*
* include/proto/activity.h
* include/haproxy/activity.h
* This file contains macros and inline functions for activity measurements.
*
* Copyright (C) 2000-2018 Willy Tarreau - w@1wt.eu
* Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -19,26 +19,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _PROTO_ACTIVITY_H
#define _PROTO_ACTIVITY_H
#ifndef _HAPROXY_ACTIVITY_H
#define _HAPROXY_ACTIVITY_H
#include <haproxy/atomic.h>
#include <haproxy/api.h>
#include <haproxy/time.h>
#include <types/activity.h>
#include <haproxy/activity-t.h>
#include <haproxy/freq_ctr.h>
/* bit fields for "profiling" */
#define HA_PROF_TASKS_OFF 0x00000000 /* per-task CPU profiling forced disabled */
#define HA_PROF_TASKS_AUTO 0x00000001 /* per-task CPU profiling automatic */
#define HA_PROF_TASKS_ON 0x00000002 /* per-task CPU profiling forced enabled */
#define HA_PROF_TASKS_MASK 0x00000003 /* per-task CPU profiling mask */
extern unsigned int profiling;
extern unsigned long task_profiling_mask;
extern struct activity activity[MAX_THREADS];
void report_stolen_time(uint64_t stolen);
/* Collect date and time information before calling poll(). This will be used
@ -99,7 +92,7 @@ static inline void activity_count_runtime()
}
#endif /* _PROTO_ACTIVITY_H */
#endif /* _HAPROXY_ACTIVITY_H */
/*
* Local variables:

View File

@ -31,7 +31,7 @@
#include <common/ticks.h>
#include <haproxy/time.h>
#include <types/fd.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
/* public variables */

View File

@ -14,7 +14,7 @@
#include <common/cfgparse.h>
#include <common/standard.h>
#include <haproxy/thread-t.h>
#include <types/activity.h>
#include <haproxy/activity-t.h>
#include <proto/channel.h>
#include <proto/cli.h>
#include <haproxy/freq_ctr.h>

View File

@ -41,7 +41,7 @@
#include <types/dns.h>
#include <types/stats.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
#include <proto/backend.h>
#include <proto/channel.h>
#include <proto/checks.h>

View File

@ -22,7 +22,7 @@
#include <types/global.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
#include <proto/fd.h>
#include <proto/signal.h>

View File

@ -25,7 +25,7 @@
#include <types/global.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
#include <proto/fd.h>
#include <proto/log.h>
#include <proto/signal.h>

View File

@ -24,7 +24,7 @@
#include <types/global.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
#include <proto/fd.h>
#include <proto/signal.h>

View File

@ -24,7 +24,7 @@
#include <types/global.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
#include <proto/fd.h>

View File

@ -21,7 +21,7 @@
#include <types/global.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
#include <proto/fd.h>

View File

@ -105,7 +105,7 @@
#include <types/peers.h>
#include <proto/acl.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
#include <proto/arg.h>
#include <proto/auth.h>
#include <proto/backend.h>

View File

@ -23,7 +23,7 @@
#include <haproxy/list.h>
#include <common/standard.h>
#include <types/activity.h>
#include <haproxy/activity-t.h>
#include <proto/applet.h>
#include <proto/cli.h>

View File

@ -30,7 +30,7 @@
#include <proto/acl.h>
#include <proto/action.h>
#include <proto/activity.h>
#include <haproxy/activity.h>
#include <proto/arg.h>
#include <proto/backend.h>
#include <proto/channel.h>