Skip to content

Commit

Permalink
Revert "tracer: always load the trace api"
Browse files Browse the repository at this point in the history
This reverts commit 7791304 which forced
one to load proto_hep and define at least 1 listener for it even when HEP
was not used, in order to have the tracer module load.
  • Loading branch information
danpascu committed May 2, 2019
1 parent 216dc40 commit 08cff34
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions modules/tracer/tracer.c
Expand Up @@ -836,16 +836,23 @@ static int mod_init(void)

*trace_on_flag = trace_on;

if (trace_prot_bind(TRACE_PROTO, &tprot)) {
LM_ERR("Failed to bind tracing protocol!\n");
return -1;
}

/* initialize hep api */
for (it=trace_list;it;it=it->next) {
if (it->type!=TYPE_HEP)
continue;

if (tprot.get_trace_dest_by_name == NULL) {
LM_DBG("Loading tracing protocol!\n");
/*
* if more tracing protocols shall implement the api then
* this should be a modparam
*/
if (trace_prot_bind(TRACE_PROTO, &tprot)) {
LM_ERR("Failed to bind tracing protocol!\n");
return -1;
}
}

it->el.hep.hep_id = tprot.get_trace_dest_by_name(&it->el.hep.name);
if (it->el.hep.hep_id == NULL) {
LM_ERR("hep id not found!\n");
Expand Down

0 comments on commit 08cff34

Please sign in to comment.