X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Fust%2Ftracepoint.h;h=6da3097766c9d351c979aecf10daab52e8694b05;hb=24b6668c651f21d415b4f3a4533c7c6c6692aa73;hp=908d5abd553378c0cb0ffa0292e49541f4596ae0;hpb=2f03197d3d05b272f82ed261a0a7b2bbb2f66ab0;p=ust.git diff --git a/include/ust/tracepoint.h b/include/ust/tracepoint.h index 908d5ab..6da3097 100644 --- a/include/ust/tracepoint.h +++ b/include/ust/tracepoint.h @@ -200,6 +200,7 @@ struct tracepoint_lib { extern int tracepoint_register_lib(struct tracepoint *tracepoints_start, int tracepoints_count); +extern int tracepoint_unregister_lib(struct tracepoint *tracepoints_start); #define TRACEPOINT_LIB \ extern struct tracepoint __start___tracepoints[] __attribute__((weak, visibility("hidden"))); \ @@ -208,6 +209,11 @@ extern int tracepoint_register_lib(struct tracepoint *tracepoints_start, { \ tracepoint_register_lib(__start___tracepoints, \ (((long)__stop___tracepoints)-((long)__start___tracepoints))/sizeof(struct tracepoint)); \ + } \ + \ + static void __attribute__((destructor)) __tracepoints__destroy(void) \ + { \ + tracepoint_unregister_lib(__start___tracepoints); \ } #endif /* _UST_TRACEPOINT_H */