X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Fhealth-internal.hpp;fp=include%2Flttng%2Fhealth-internal.hpp;h=a3bf001ce757879c8eb728286c1961b720da18a5;hp=b1dc33047db713aec10181496d8edd83c4dbd6fa;hb=28f23191dcbf047429d51950a337a57d7a3f866a;hpb=f250b40e2179eccdb83766bf4abef5a35036c47b diff --git a/include/lttng/health-internal.hpp b/include/lttng/health-internal.hpp index b1dc33047..a3bf001ce 100644 --- a/include/lttng/health-internal.hpp +++ b/include/lttng/health-internal.hpp @@ -10,26 +10,28 @@ */ #include +#include + +#include + #include +#include #include #include -#include -#include -#include /* * These are the value added to the current state depending of the position in * the thread where is either waiting on a poll() or running in the code. */ -#define HEALTH_POLL_VALUE (1UL << 0) -#define HEALTH_CODE_VALUE (1UL << 1) +#define HEALTH_POLL_VALUE (1UL << 0) +#define HEALTH_CODE_VALUE (1UL << 1) -#define HEALTH_IS_IN_POLL(x) ((x) & HEALTH_POLL_VALUE) +#define HEALTH_IS_IN_POLL(x) ((x) &HEALTH_POLL_VALUE) struct health_app; enum health_flags { - HEALTH_ERROR = (1U << 0), + HEALTH_ERROR = (1U << 0), }; struct health_state { @@ -43,23 +45,23 @@ struct health_state { /* * current and flags are updated by multiple threads concurrently. */ - unsigned long current; /* progress counter, updated atomically */ - enum health_flags flags; /* other flags, updated atomically */ - int type; /* Indicates the nature of the thread. */ + unsigned long current; /* progress counter, updated atomically */ + enum health_flags flags; /* other flags, updated atomically */ + int type; /* Indicates the nature of the thread. */ /* Node of the global TLS state list. */ struct cds_list_head node; }; enum health_cmd { - HEALTH_CMD_CHECK = 0, + HEALTH_CMD_CHECK = 0, }; struct health_comm_msg { - uint32_t cmd; /* enum health_cmd */ + uint32_t cmd; /* enum health_cmd */ } LTTNG_PACKED; struct health_comm_reply { - uint64_t ret_code; /* bitmask of threads in bad health */ + uint64_t ret_code; /* bitmask of threads in bad health */ } LTTNG_PACKED; /* Declare TLS health state. */ @@ -73,8 +75,7 @@ extern DECLARE_URCU_TLS(struct health_state, health_state); static inline void health_poll_entry() { /* Code MUST be in code execution state which is an even number. */ - LTTNG_ASSERT(!(uatomic_read(&URCU_TLS(health_state).current) - & HEALTH_POLL_VALUE)); + LTTNG_ASSERT(!(uatomic_read(&URCU_TLS(health_state).current) & HEALTH_POLL_VALUE)); uatomic_add(&URCU_TLS(health_state).current, HEALTH_POLL_VALUE); } @@ -87,8 +88,7 @@ static inline void health_poll_entry() static inline void health_poll_exit() { /* Code MUST be in poll execution state which is an odd number. */ - LTTNG_ASSERT(uatomic_read(&URCU_TLS(health_state).current) - & HEALTH_POLL_VALUE); + LTTNG_ASSERT(uatomic_read(&URCU_TLS(health_state).current) & HEALTH_POLL_VALUE); uatomic_add(&URCU_TLS(health_state).current, HEALTH_POLL_VALUE); }