+#define TRACEPOINT_EVENT_LIB \
+ extern struct trace_event * const __start___trace_events_ptrs[] \
+ __attribute__((weak, visibility("hidden"))); \
+ extern struct trace_event * const __stop___trace_events_ptrs[] \
+ __attribute__((weak, visibility("hidden"))); \
+ static struct trace_event * __event_ptrs_dummy \
+ __attribute__((used, section("__trace_events_ptrs"))); \
+ static void __attribute__((constructor)) \
+ __trace_events__init(void) \
+ { \
+ trace_event_register_lib(__start___trace_events_ptrs, \
+ __stop___trace_events_ptrs - \
+ __start___trace_events_ptrs); \
+ } \
+ \
+ static void __attribute__((destructor)) \
+ __trace_event__destroy(void) \
+ { \
+ trace_event_unregister_lib(__start___trace_events_ptrs);\
+ }
+
+struct trace_event {
+ const char *name;
+};
+
+struct trace_event_lib {
+ struct trace_event * const *trace_events_start;
+ int trace_events_count;
+ struct cds_list_head list;
+};
+
+extern
+int trace_event_register_lib(struct trace_event * const *start_trace_events,
+ int trace_event_count);
+extern
+int trace_event_unregister_lib(struct trace_event * const *start_trace_events);