X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libust%2Ftracepoint.c;h=8eee320d4149bbc7bca9416ce7264a4c2821a900;hb=235ae2d7303901d08aac894a901092aa56164775;hp=584b3ffe1af50ffdb01f383ed9ba6ace0fb267bc;hpb=909bc43f70be2b1d3efcefe33121ee1e99d9895b;p=ust.git diff --git a/libust/tracepoint.c b/libust/tracepoint.c index 584b3ff..8eee320 100644 --- a/libust/tracepoint.c +++ b/libust/tracepoint.c @@ -19,23 +19,11 @@ * Ported to userspace by Pierre-Marc Fournier. */ -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include - #include - -#include #include +#include +#include #include "usterr.h" -//#include "list.h" #define _LGPL_SOURCE #include @@ -678,10 +666,22 @@ int tracepoint_register_lib(struct tracepoint *tracepoints_start, int tracepoint return 0; } -int tracepoint_unregister_lib(struct tracepoint *tracepoints_start, int tracepoints_count) +int tracepoint_unregister_lib(struct tracepoint *tracepoints_start) { - /*FIXME: implement; but before implementing, tracepoint_register_lib must - have appropriate locking. */ + struct tracepoint_lib *lib; + + mutex_lock(&tracepoints_mutex); + + list_for_each_entry(lib, &libs, list) { + if(lib->tracepoints_start == tracepoints_start) { + struct tracepoint_lib *lib2free = lib; + list_del(&lib->list); + free(lib2free); + break; + } + } + + mutex_unlock(&tracepoints_mutex); return 0; }