X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fhealth.h;h=b348be5f0144e85b4309624c747026c0090d5e3c;hp=b268860156aa4e1c2e24db3fd2acb9600e5ed640;hb=8809eec0bb55b03862cb1eb128eb39d50104c258;hpb=139ac87245fd1ca18d60a0efca32b50e4c1d8730 diff --git a/src/bin/lttng-sessiond/health.h b/src/bin/lttng-sessiond/health.h index b26886015..b348be5f0 100644 --- a/src/bin/lttng-sessiond/health.h +++ b/src/bin/lttng-sessiond/health.h @@ -19,6 +19,7 @@ #define _HEALTH_H #include +#include #include /* @@ -31,16 +32,18 @@ #define HEALTH_IS_IN_POLL(x) ((x) & HEALTH_POLL_VALUE) enum health_flags { - HEALTH_EXIT = (1U << 0), + HEALTH_EXIT = (1U << 0), HEALTH_ERROR = (1U << 1), }; struct health_state { /* - * last counter is only read and updated by the health_check + * last counter and last_time are only read and updated by the health_check * thread (single updater). */ unsigned long last; + struct timespec last_time; + /* * current and flags are updated by multiple threads concurrently. */ @@ -104,7 +107,9 @@ static inline void health_error(struct health_state *state) static inline void health_init(struct health_state *state) { assert(state); - uatomic_set(&state->last, 0); + state->last = 0; + state->last_time.tv_sec = 0; + state->last_time.tv_nsec = 0; uatomic_set(&state->current, 0); uatomic_set(&state->flags, 0); }