X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fust-tracepoint-event.h;h=49cac590d421a689ab33855c6ebf63e22c863e99;hb=882a56d75d6054e1bf35d1bcddd668be4da4980f;hp=5066b4b6ad3b814aab3c6f777922e89cae33aee2;hpb=df854e41ded4203a5b86bac062b8604bb038759a;p=lttng-ust.git diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 5066b4b6..49cac590 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -117,6 +117,25 @@ void _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void) #include TRACEPOINT_INCLUDE } +/* + * Stage 0.1 of tracepoint event generation. + * + * Check that each TRACEPOINT_EVENT provider:name does not exceed the + * tracepoint name length limit. + */ + +/* Reset all macros within TRACEPOINT_EVENT */ +#include + +#undef TRACEPOINT_EVENT_INSTANCE +#define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \ +static const char \ + __tp_name_len_check##_provider##___##_name[LTTNG_UST_SYM_NAME_LEN] \ + __attribute__((unused)) = \ + #_provider ":" #_name; + +#include TRACEPOINT_INCLUDE + /* * Stage 1 of tracepoint event generation. * @@ -415,49 +434,7 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))\ #undef __get_dynamic_len /* - * Stage 6.1 of tracepoint event generation. - * - * Tracepoint loglevel enumeration definition generation. - */ - -/* Reset all macros within TRACEPOINT_EVENT */ -#include - -#undef TRACEPOINT_LOGLEVEL_ENUM -#define TRACEPOINT_LOGLEVEL_ENUM(...) __VA_ARGS__ - -#undef tp_loglevel -#define tp_loglevel(_identifier, _value) \ -static const struct tracepoint_loglevel_entry \ - _TP_COMBINE_TOKENS4(__tp_loglevel_entry__, TRACEPOINT_PROVIDER, ___, _identifier) = { \ - .identifier = #_identifier, \ - .value = (_value), \ - }; - -#include TRACEPOINT_INCLUDE - -/* - * Stage 6.2 of tracepoint event generation. - * - * Tracepoint loglevel enumeration array generation. - */ - -/* Reset all macros within TRACEPOINT_EVENT */ -#include - -#undef TRACEPOINT_LOGLEVEL_ENUM -#define TRACEPOINT_LOGLEVEL_ENUM(...) __VA_ARGS__ - -#undef tp_loglevel -#define tp_loglevel(_identifier, _value) \ - &_TP_COMBINE_TOKENS4(__tp_loglevel_entry__, TRACEPOINT_PROVIDER, ___, _identifier), \ - -static const struct tracepoint_loglevel_entry *_TP_COMBINE_TOKENS(__tracepoint_loglevel_enum__, TRACEPOINT_PROVIDER)[] = { -#include TRACEPOINT_INCLUDE -}; - -/* - * Stage 7 of tracepoint event generation. + * Stage 6 of tracepoint event generation. * * Tracepoint loglevel mapping definition generation. We generate a * symbol for each mapping for a provider/event to ensure at most a 1 to @@ -470,14 +447,12 @@ static const struct tracepoint_loglevel_entry *_TP_COMBINE_TOKENS(__tracepoint_l #undef TRACEPOINT_LOGLEVEL #define TRACEPOINT_LOGLEVEL(__provider, __name, __loglevel) \ -static const struct tracepoint_loglevel_entry * \ - _loglevel_mapping___##__provider##___##__name = \ - &__tp_loglevel_entry__##__provider##___##__loglevel; +static const int _loglevel___##__provider##___##__name = __loglevel; #include TRACEPOINT_INCLUDE /* - * Stage 8.1 of tracepoint event generation. + * Stage 7.1 of tracepoint event generation. * * Create events description structures. We use a weakref because * loglevels are optional. If not declared, the event will point to the @@ -489,21 +464,21 @@ static const struct tracepoint_loglevel_entry * \ #undef TRACEPOINT_EVENT_INSTANCE #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \ -static const struct tracepoint_loglevel_entry * \ - __ref_loglevel_mapping___##_provider##___##_name \ - __attribute__((weakref ("_loglevel_mapping___" #_provider "___" #_name))); \ +static const int * \ + __ref_loglevel___##_provider##___##_name \ + __attribute__((weakref ("_loglevel___" #_provider "___" #_name))); \ const struct lttng_event_desc __event_desc___##_provider##_##_name = { \ .fields = __event_fields___##_provider##___##_template, \ .name = #_provider ":" #_name, \ .probe_callback = (void *) &__event_probe__##_provider##___##_template,\ .nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template), \ - .loglevel = &__ref_loglevel_mapping___##_provider##___##_name, \ + .loglevel = &__ref_loglevel___##_provider##___##_name, \ }; #include TRACEPOINT_INCLUDE /* - * Stage 8.2 of tracepoint event generation. + * Stage 7.2 of tracepoint event generation. * * Create array of events. */ @@ -521,7 +496,7 @@ static const struct lttng_event_desc *_TP_COMBINE_TOKENS(__event_desc___, TRACEP /* - * Stage 9 of tracepoint event generation. + * Stage 8 of tracepoint event generation. * * Create a toplevel descriptor for the whole probe. */ @@ -531,12 +506,10 @@ static struct lttng_probe_desc _TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PR .provider = __tp_stringify(TRACEPOINT_PROVIDER), .event_desc = _TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER), .nr_events = _TP_ARRAY_SIZE(_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)), - .loglevels = _TP_COMBINE_TOKENS(__tracepoint_loglevel_enum__, TRACEPOINT_PROVIDER), - .nr_loglevels = _TP_ARRAY_SIZE(_TP_COMBINE_TOKENS(__tracepoint_loglevel_enum__, TRACEPOINT_PROVIDER)), }; /* - * Stage 10 of tracepoint event generation. + * Stage 9 of tracepoint event generation. * * Register/unregister probes at module load/unload. */