42 #define N_PROF_STAT_IDS sizeof(profiler_stat_ids) / sizeof(*profiler_stat_ids)
47 float r = (float)rand() / (float)RAND_MAX;
49 hdr->do_profile =
false;
52 hdr->do_profile =
true;
60 log_warn(
"Profiler initialized twice!");
Collecting statistics within the runtime.
Header for messages passed to MSUs.
void set_profiling(struct msu_msg_hdr *hdr)
Sets the profiling flag on the header based on the tag_probability.
enum stat_id profiler_stat_ids[]
The stat IDs relevant to profiling.
stat_id
The identifiers with which stats can be logged.
Logging of status messages to the terminal.
void init_profiler(float tag_prob)
Initializes the profiler to tag headers with tag_prob probability.
Functions for the sending and receiving of statistics between ctrl and runtime.
For profiling the path of MSU messages through DeDOS.
static float tag_probability
The probability that an MSU message will get marked for profiling.
int init_stat_item(enum stat_id stat_id, unsigned int item_id)
Initializes a stat item so that statistics can be logged to it.
#define PROFILER_ITEM_ID
The ID with which all profiled messages are tagged in the stats module.
#define log_warn(fmt,...)