My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
profiler.h File Reference

For profiling the path of MSU messages through DeDOS. More...

#include "msu_message.h"
#include "stat_ids.h"
#include "rt_stats.h"

Go to the source code of this file.

Macros

#define PROFILER_ITEM_ID   101
 The ID with which all profiled messages are tagged in the stats module. More...
 
#define SET_PROFILING(hdr)
 Sets whether the header should be profiled. More...
 
#define INIT_PROFILER(tprof)
 Initializes the profiler with the provided probability of profiling. More...
 
#define PROFILE_EVENT(hdr, stat_id)
 If the header is marked for profiling, profiles the given event. More...
 

Functions

void set_profiling (struct msu_msg_hdr *hdr)
 Sets the profiling flag in the header based on the tag_probability provided to init_profiler. More...
 
void init_profiler (float tag_probability)
 Sets the probability of profiling an MSU message. More...
 

Detailed Description

For profiling the path of MSU messages through DeDOS.

Note: #DEDOS_PROFILER must be defined for profiling to do anything!

Definition in file profiler.h.

Macro Definition Documentation

#define INIT_PROFILER (   tprof)
Value:
if (tprof > 0) \
log_warn("Profiling probability set to %f but profiling is disabled", tprof)
#define log_warn(fmt,...)
Definition: logging.h:113

Initializes the profiler with the provided probability of profiling.

Ignored if #DEDOS_PROFILE is not defined

Definition at line 69 of file profiler.h.

#define PROFILE_EVENT (   hdr,
  stat_id 
)

If the header is marked for profiling, profiles the given event.

Ignored if #DEDOS_PROFILE is not defined.

Definition at line 77 of file profiler.h.

#define PROFILER_ITEM_ID   101

The ID with which all profiled messages are tagged in the stats module.

Definition at line 34 of file profiler.h.

#define SET_PROFILING (   hdr)

Sets whether the header should be profiled.

Ignored if #DEDOS_PROFILE is not defined

Definition at line 65 of file profiler.h.

Function Documentation

void init_profiler ( float  tag_prob)

Sets the probability of profiling an MSU message.

Sets the probability of profiling an MSU message.

Definition at line 58 of file profiler.c.

void set_profiling ( struct msu_msg_hdr hdr)

Sets the profiling flag in the header based on the tag_probability provided to init_profiler.

Sets the profiling flag in the header based on the tag_probability provided to init_profiler.

Definition at line 45 of file profiler.c.