* 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 <ust/core.h>
+#include <ust/kcompat/kcompat.h>
#include "usterr.h"
-//#include "list.h"
#define _LGPL_SOURCE
#include <urcu-bp.h>
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;
}