diff --git a/server/stat.h b/server/stat.h index adbf46bf..6cb00469 100644 --- a/server/stat.h +++ b/server/stat.h @@ -101,17 +101,24 @@ static inline void stat_reset(G_GNUC_UNUSED stat_info_t *info) #endif } -static inline void stat_compress_init(G_GNUC_UNUSED stat_info_t *info, - G_GNUC_UNUSED const char *name, - G_GNUC_UNUSED clockid_t clock) +static inline void stat_init(G_GNUC_UNUSED stat_info_t *info, + G_GNUC_UNUSED const char *name, + G_GNUC_UNUSED clockid_t clock) { -#ifdef COMPRESS_STAT +#if defined(RED_WORKER_STAT) || defined(COMPRESS_STAT) info->name = name; info->clock = clock; stat_reset(info); #endif } +static inline void stat_compress_init(G_GNUC_UNUSED stat_info_t *info, + G_GNUC_UNUSED const char *name, + G_GNUC_UNUSED clockid_t clock) +{ + stat_init(info, name, clock); +} + static inline void stat_compress_add(G_GNUC_UNUSED stat_info_t *info, G_GNUC_UNUSED stat_start_time_t start, G_GNUC_UNUSED int orig_size, @@ -134,17 +141,6 @@ static inline double stat_byte_to_mega(uint64_t size) return (double)size / (1000 * 1000); } -static inline void stat_init(G_GNUC_UNUSED stat_info_t *info, - G_GNUC_UNUSED const char *name, - G_GNUC_UNUSED clockid_t clock) -{ -#ifdef RED_WORKER_STAT - info->name = name; - info->clock = clock; - stat_reset(info); -#endif -} - static inline void stat_add(G_GNUC_UNUSED stat_info_t *info, G_GNUC_UNUSED stat_start_time_t start) {