34 #define PROFILER_ITEM_ID 101
49 #define SET_PROFILING(hdr) set_profiling(&hdr)
53 #define INIT_PROFILER(tprof) init_profiler(tprof)
59 #define PROFILE_EVENT(hdr, stat_id) \
60 if (hdr.do_profile && hdr.key.id != 0) \
61 record_stat(stat_id, PROFILER_ITEM_ID, (double)hdr.key.id, true)
65 #define SET_PROFILING(hdr)
69 #define INIT_PROFILER(tprof) \
71 log_warn("Profiling probability set to %f but profiling is disabled", tprof)
77 #define PROFILE_EVENT(hdr, stat_id)
79 #endif // DEDOS_PROFILER
81 #endif // PROFILER_H__
Collecting statistics within the runtime.
Header for messages passed to MSUs.
void set_profiling(struct msu_msg_hdr *hdr)
Sets the profiling flag in the header based on the tag_probability provided to init_profiler.
void init_profiler(float tag_probability)
Sets the probability of profiling an MSU message.
static float tag_probability
The probability that an MSU message will get marked for profiling.
Declares the identifiers with which stats can be logged.