X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Fust%2Fust_trace.h;h=01c241d644763e57a079878178e83cec68645e61;hb=0c0686eefbf60682c54bc4b3c0bc593250deedc1;hp=e1b02576d6ef93b88c45bca1cdcdcf071e355d09;hpb=1e620c5350cfbd0b0be4122547115dd4da503bcf;p=ust.git diff --git a/include/ust/ust_trace.h b/include/ust/ust_trace.h index e1b0257..01c241d 100644 --- a/include/ust/ust_trace.h +++ b/include/ust/ust_trace.h @@ -23,6 +23,8 @@ * to a printf */ +#include + /* * Stage 1. Create a struct and a printf calling function * that is connected to the tracepoint at load time. @@ -66,6 +68,20 @@ \ printf(print); \ } \ + static inline int register_event_##name(void *data) \ + { \ + return register_trace_##name(trace_printf_##name, data); \ + } \ + static inline int unregister_event_##name(void *data) \ + { \ + return unregister_trace_##name(trace_printf_##name, data); \ + } \ + struct trace_event __event_##name \ + __attribute__((section("__trace_events"), aligned(32))) = { \ + __tpstrtab_##name, \ + register_event_##name, \ + unregister_event_##name \ + }; \ static void __attribute__((constructor)) init_##name() \ { \ void *dummy; \