From: Ikaheimonen, JP Date: Thu, 3 Oct 2013 06:46:27 +0000 (+0000) Subject: Store the callsites into the library callsite list X-Git-Tag: v2.2.2~11 X-Git-Url: http://git.liburcu.org/?p=lttng-ust.git;a=commitdiff_plain;h=632c1bda6c5a1110a2cdc6fe1d29529f33aa9888 Store the callsites into the library callsite list Fix the issue where the callsites are registered but never properly unregistered. [ Edit by Mathieu Desnoyers: minor coding style fix: remove parenthesis. ] Signed-off-by: Ikaheimonen, JP Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/tracepoint.c b/liblttng-ust/tracepoint.c index 7bb38fa9..b46bd84b 100644 --- a/liblttng-ust/tracepoint.c +++ b/liblttng-ust/tracepoint.c @@ -314,7 +314,7 @@ static void remove_tracepoint(struct tracepoint_entry *e) * Add the callsite to the callsite hash table. Must be called with * tracepoint mutex held. */ -static void add_callsite(struct tracepoint *tp) +static void add_callsite(struct tracepoint_lib * lib, struct tracepoint *tp) { struct cds_hlist_head *head; struct callsite_entry *e; @@ -332,6 +332,7 @@ static void add_callsite(struct tracepoint *tp) assert(e); cds_hlist_add_head(&e->hlist, head); e->tp = tp; + cds_list_add(&e->node, &lib->callsites); } /* @@ -480,7 +481,7 @@ static void lib_register_callsites(struct tracepoint_lib *lib) if (!(*iter)->name) { continue; } - add_callsite(*iter); + add_callsite(lib, *iter); } }