MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / init_profiling_event

Function init_profiling_event

profiling.c:82–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82static int init_profiling_event(profiling_event_handle_t *ev, str *ev_name)
83{
84 ev->id = evi_publish_event(*ev_name);
85 if (ev->id == EVI_ERROR) {
86 LM_ERR("cannot register '%.*s' event\n", ev_name->len, ev_name->s);
87 return -1;
88 }
89
90 ev->params = evi_get_params();
91 if (!ev->params) {
92 LM_ERR("cannot create params for '%.*s'\n", ev_name->len, ev_name->s);
93 return -1;
94 }
95 ev->params->flags &= ~EVI_FREE_LIST;
96
97 ev->sec_p = evi_param_create(ev->params, &ev_param_sec);
98 ev->usec_p = evi_param_create(ev->params, &ev_param_usec);
99 ev->session_p = evi_param_create(ev->params, &ev_param_session);
100 ev->verb_p = evi_param_create(ev->params, &ev_param_verb);
101 ev->name_p = evi_param_create(ev->params, &ev_param_name);
102 ev->type_p = evi_param_create(ev->params, &ev_param_type);
103 ev->depth_p = evi_param_create(ev->params, &ev_param_depth);
104 ev->file_p = evi_param_create(ev->params, &ev_param_file);
105 ev->line_p = evi_param_create(ev->params, &ev_param_line);
106 ev->status_p = evi_param_create(ev->params, &ev_param_status);
107 if (!ev->sec_p || !ev->usec_p || !ev->session_p || !ev->verb_p ||
108 !ev->name_p || !ev->type_p || !ev->depth_p || !ev->file_p ||
109 !ev->line_p || !ev->status_p) {
110 LM_ERR("cannot create params for '%.*s'\n", ev_name->len, ev_name->s);
111 return -1;
112 }
113
114 return 0;
115}
116
117static inline void profiling_raise_event(int data_type, char *verb,
118 const char *name, int type, int depth, const char *file, int line,

Callers 1

init_profilingFunction · 0.85

Calls 3

evi_publish_eventFunction · 0.85
evi_get_paramsFunction · 0.85
evi_param_createFunction · 0.85

Tested by

no test coverage detected