remove some unused code
[ust.git] / libust / tracepoint.c
index 584b3ffe1af50ffdb01f383ed9ba6ace0fb267bc..dd2ad7fae24fcc37615db05bda2e6a917e2889e6 100644 (file)
  * Ported to userspace by Pierre-Marc Fournier.
  */
 
-//ust// #include <linux/module.h>
-//ust// #include <linux/mutex.h>
-//ust// #include <linux/types.h>
-//ust// #include <linux/jhash.h>
-//ust// #include <linux/list.h>
-//ust// #include <linux/rcupdate.h>
-//ust// #include <linux/tracepoint.h>
-//ust// #include <linux/err.h>
-//ust// #include <linux/slab.h>
-//ust// #include <linux/immediate.h>
-
 #include <errno.h>
 
 #include <ust/kernelcompat.h>
 #include <ust/tracepoint.h>
 #include "usterr.h"
-//#include "list.h"
 
 #define _LGPL_SOURCE
 #include <urcu-bp.h>
@@ -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;
 }
This page took 0.023442 seconds and 4 git commands to generate.