X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Flttng%2Fust-tracepoint-event.h;h=5d845ae1e4bb0246cef8cda5495b89e04aa89c17;hb=HEAD;hp=baf9879371898289ff5d9cef25763403f9448be1;hpb=1c1968450409b3c159a3000f9e1a968ff1e5f7e8;p=lttng-ust.git diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index baf98793..5cc69d85 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -255,6 +255,38 @@ void lttng_ust__event_template_proto___##_provider##___##_name(LTTNG_UST__TP_ARG }; #include LTTNG_UST_TRACEPOINT_INCLUDE + +/* + * Stage 0.9.0 + * Verifying sequence length types are of an unsigned type. + */ + +/* Reset all macros within LTTNG_UST_TRACEPOINT_EVENT */ +#include +#include +#include + +/* + * Note that it is not possible to encode the length type as a C identifier, + * since it can be multiple tokens. + */ +#undef lttng_ust__field_sequence_encoded +#define lttng_ust__field_sequence_encoded(_type, _item, _src, _byte_order, \ + _length_type, _src_length, _encoding, _nowrite, \ + _elem_type_base) \ + lttng_ust_static_assert(!lttng_ust_is_signed_type(_length_type), \ + "Length type " #_length_type " is not a unsigned integer type", \ + Length_type_is_not_a_unsigned_integer_type); + +#undef LTTNG_UST_TP_FIELDS +#define LTTNG_UST_TP_FIELDS(...) __VA_ARGS__ /* Only one used in this phase */ + +#undef LTTNG_UST__TRACEPOINT_EVENT_CLASS +#define LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \ + _fields + +#include LTTNG_UST_TRACEPOINT_INCLUDE + #if defined(__cplusplus) /* @@ -940,6 +972,7 @@ static \ void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PROTO(_args)) \ { \ struct lttng_ust_event_common *__event = (struct lttng_ust_event_common *) __tp_data; \ + struct lttng_ust_channel_common *__chan_common; \ size_t __dynamic_len_idx = 0; \ const size_t __num_fields = LTTNG_UST__TP_ARRAY_SIZE(lttng_ust__event_fields___##_provider##___##_name) - 1; \ struct lttng_ust_probe_ctx __probe_ctx; \ @@ -952,28 +985,19 @@ void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PRO \ if (0) \ (void) __dynamic_len_idx; /* don't warn if unused */ \ - switch (__event->type) { \ - case LTTNG_UST_EVENT_TYPE_RECORDER: \ - { \ - struct lttng_ust_event_recorder *__event_recorder = (struct lttng_ust_event_recorder *) __event->child; \ - struct lttng_ust_channel_buffer *__chan = __event_recorder->chan; \ - struct lttng_ust_channel_common *__chan_common = __chan->parent; \ - \ + if (caa_unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \ + return; \ + if (caa_unlikely(!LTTNG_UST_TP_RCU_LINK_TEST())) \ + return; \ + __chan_common = lttng_ust_get_chan_common_from_event_common(__event); \ + if (__chan_common) { \ if (!LTTNG_UST__TP_SESSION_CHECK(session, __chan_common->session)) \ return; \ if (caa_unlikely(!CMM_ACCESS_ONCE(__chan_common->session->active))) \ return; \ if (caa_unlikely(!CMM_ACCESS_ONCE(__chan_common->enabled))) \ return; \ - break; \ - } \ - case LTTNG_UST_EVENT_TYPE_NOTIFIER: \ - break; \ } \ - if (caa_unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \ - return; \ - if (caa_unlikely(!LTTNG_UST_TP_RCU_LINK_TEST())) \ - return; \ __probe_ctx.struct_size = sizeof(struct lttng_ust_probe_ctx); \ __probe_ctx.ip = LTTNG_UST__TP_IP_PARAM(LTTNG_UST_TP_IP_PARAM); \ if (caa_unlikely(CMM_ACCESS_ONCE(__event->eval_filter))) { \ @@ -1022,6 +1046,24 @@ void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_DATA_PRO &__notif_ctx); \ break; \ } \ + case LTTNG_UST_EVENT_TYPE_COUNTER: \ + { \ + struct lttng_ust_event_counter *__event_counter = (struct lttng_ust_event_counter *) __event->child; \ + struct lttng_ust_event_counter_ctx __event_counter_ctx; \ + \ + __event_counter_ctx.struct_size = sizeof(struct lttng_ust_event_counter_ctx); \ + __event_counter_ctx.args_available = CMM_ACCESS_ONCE(__event_counter->use_args); \ + \ + if (caa_unlikely(!__interpreter_stack_prepared && __event_counter_ctx.args_available)) \ + lttng_ust__event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \ + LTTNG_UST__TP_ARGS_DATA_VAR(_args)); \ + \ + (void) __event_counter->chan->ops->counter_hit(__event_counter, \ + __stackvar.__interpreter_stack_data, \ + &__probe_ctx, \ + &__event_counter_ctx); \ + break; \ + } \ } \ }