X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fust-tracepoint-event.h;h=c9c7592938427bfd228d3dd9a031189fbfc9aeca;hb=d8d2416dab454962b90222ba46c82cdce0c666a4;hp=622befe0be71183a86ce2502cd1b6670fde4f1f0;hpb=8968a99fff433db0ce9268ed8f4107ddaf072186;p=lttng-ust.git diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 622befe0..c9c75929 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -433,6 +433,24 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)); #include TRACEPOINT_INCLUDE +/* + * Stage 2.1 of tracepoint event generation. + * + * Create probe event notifier callback prototypes. + */ + +/* Reset all macros within TRACEPOINT_EVENT */ +#include + +#undef TP_ARGS +#define TP_ARGS(...) __VA_ARGS__ + +#undef TRACEPOINT_EVENT_CLASS +#define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \ +static void __event_notifier_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)); + +#include TRACEPOINT_INCLUDE + /* * Stage 3.0 of tracepoint event generation. * @@ -913,6 +931,48 @@ static const char __tp_event_signature___##_provider##___##_name[] = \ #undef _TP_EXTRACT_STRING2 +/* + * Stage 5.2 of tracepoint event generation. + * + * Create the event notifier probe function. + */ +#undef TRACEPOINT_EVENT_CLASS +#define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \ +static lttng_ust_notrace \ +void __event_notifier_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)); \ +static \ +void __event_notifier_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \ +{ \ + struct lttng_event_notifier *__event_notifier = (struct lttng_event_notifier *) __tp_data; \ + const size_t __num_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_name) - 1;\ + union { \ + size_t __dynamic_len[__num_fields]; \ + char __filter_stack_data[2 * sizeof(unsigned long) * __num_fields]; \ + } __stackvar; \ + if (caa_unlikely(!CMM_ACCESS_ONCE(__event_notifier->enabled))) \ + return; \ + if (caa_unlikely(!TP_RCU_LINK_TEST())) \ + return; \ + if (caa_unlikely(!cds_list_empty(&__event_notifier->filter_bytecode_runtime_head))) { \ + struct lttng_bytecode_runtime *__filter_bc_runtime; \ + int __filter_record = __event_notifier->has_enablers_without_bytecode; \ + \ + __event_prepare_filter_stack__##_provider##___##_name(__stackvar.__filter_stack_data, \ + _TP_ARGS_DATA_VAR(_args)); \ + tp_list_for_each_entry_rcu(__filter_bc_runtime, &__event_notifier->filter_bytecode_runtime_head, node) { \ + if (caa_unlikely(__filter_bc_runtime->filter(__filter_bc_runtime, \ + __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) \ + __filter_record = 1; \ + } \ + if (caa_likely(!__filter_record)) \ + return; \ + } \ + \ + lttng_event_notifier_notification_send(__event_notifier); \ +} + +#include TRACEPOINT_INCLUDE + /* * Stage 6 of tracepoint event generation. * @@ -1008,6 +1068,7 @@ static const struct lttng_event_desc __event_desc___##_provider##_##_name = { .u = { \ .ext = { \ .model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name, \ + .event_notifier_callback = (void (*)(void)) &__event_notifier_probe__##_provider##___##_template,\ }, \ }, \ };