X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Fust%2Fust_trace.h;h=d70ad17833b567a4124c2e11bf78b9e3aa9c0dc3;hb=b979b3468dc6a9329288f53ce568815617780d9c;hp=11d5940c68bed8ae85d1bb9b1f593fd8df9156d3;hpb=fbae86d664c12e450d3cb702b602701d37781b41;p=ust.git diff --git a/include/ust/ust_trace.h b/include/ust/ust_trace.h index 11d5940..d70ad17 100644 --- a/include/ust/ust_trace.h +++ b/include/ust/ust_trace.h @@ -32,12 +32,12 @@ #undef TRACE_EVENT #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ DECLARE_TRACE_EVENT_CLASS(name, \ - PARAMS(proto), \ - PARAMS(args), \ - PARAMS(tstruct), \ - PARAMS(assign), \ - PARAMS(print)); \ - DEFINE_TRACE_EVENT(name, name, PARAMS(proto), PARAMS(args)); + TP_PARAMS(proto), \ + TP_PARAMS(args), \ + TP_PARAMS(tstruct), \ + TP_PARAMS(assign), \ + TP_PARAMS(print)); \ + DEFINE_TRACE_EVENT(name, name, TP_PARAMS(proto), TP_PARAMS(args)); #undef __field #define __field(type, item) type item; @@ -70,22 +70,25 @@ } \ static inline int register_event_##name(void *data) \ { \ - return register_trace_##name(trace_printf_##name, data); \ + return register_tracepoint(name, trace_printf_##name, data); \ } \ static inline int unregister_event_##name(void *data) \ { \ - return unregister_trace_##name(trace_printf_##name, data); \ + return unregister_tracepoint(name, trace_printf_##name, data); \ } \ - struct trace_event __event_##name \ - __attribute__((section("__trace_events"), aligned(32))) = { \ + struct trace_event __event_##name = { \ __tpstrtab_##name, \ register_event_##name, \ unregister_event_##name \ }; \ + static struct trace_event * const __event_ptrs_##name \ + __attribute__((used, section("__trace_events_ptrs"))) = \ + &__event_##name; \ + \ static void __attribute__((constructor)) init_##name() \ { \ void *dummy = NULL; \ - register_trace_##name(trace_printf_##name, dummy); \ + register_tracepoint(name, trace_printf_##name, dummy); \ }