From: Mathieu Desnoyers Date: Sat, 26 Nov 2011 01:57:56 +0000 (+0100) Subject: Rename TP_LOGLEVEL to tp_loglevel X-Git-Tag: v1.9.1~58 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=8e90eb06e6106d536519009cb297c479643b4150;p=lttng-ust.git Rename TP_LOGLEVEL to tp_loglevel Within the loglevel enumeration, the entries are not separated by a comma. To match the style used for TP_FIELDS() ctf_*() entries, use lower-case, which denotes that these entries must not be separated by commas. Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index bce84e53..dc7832cb 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -293,29 +293,30 @@ static void __attribute__((destructor)) __tracepoints__destroy(void) * Typical use of these loglevels: * * 1) Declare the mapping between loglevel names and an integer values - * within TRACEPOINT_LOGLEVEL_ENUM, using TP_LOGLEVEL for each tuple. - * Do _NOT_ add comma (,) nor semicolon (;) between the - * TRACEPOINT_LOGLEVEL_ENUM entries. Do _NOT_ add comma (,) nor - * semicolon (;) after the TRACEPOINT_LOGLEVEL_ENUM declaration. The - * name should be a proper C99 identifier. + * within TRACEPOINT_LOGLEVEL_ENUM(), using tp_loglevel() for each + * tuple. Do _NOT_ add comma (,) nor semicolon (;) between the + * tp_loglevel entries contained within TRACEPOINT_LOGLEVEL_ENUM(). + * Do _NOT_ add comma (,) nor semicolon (;) after the + * TRACEPOINT_LOGLEVEL_ENUM() declaration. The name should be a + * proper C99 identifier. * * TRACEPOINT_LOGLEVEL_ENUM( - * TP_LOGLEVEL( < loglevel_name >, < value > ) - * TP_LOGLEVEL( < loglevel_name >, < value > ) + * tp_loglevel( < loglevel_name >, < value > ) + * tp_loglevel( < loglevel_name >, < value > ) * ... * ) * * e.g.: * * TRACEPOINT_LOGLEVEL_ENUM( - * TP_LOGLEVEL(LOG_EMERG, 0) - * TP_LOGLEVEL(LOG_ALERT, 1) - * TP_LOGLEVEL(LOG_CRIT, 2) - * TP_LOGLEVEL(LOG_ERR, 3) - * TP_LOGLEVEL(LOG_WARNING, 4) - * TP_LOGLEVEL(LOG_NOTICE, 5) - * TP_LOGLEVEL(LOG_INFO, 6) - * TP_LOGLEVEL(LOG_DEBUG, 7) + * tp_loglevel(LOG_EMERG, 0) + * tp_loglevel(LOG_ALERT, 1) + * tp_loglevel(LOG_CRIT, 2) + * tp_loglevel(LOG_ERR, 3) + * tp_loglevel(LOG_WARNING, 4) + * tp_loglevel(LOG_NOTICE, 5) + * tp_loglevel(LOG_INFO, 6) + * tp_loglevel(LOG_DEBUG, 7) * ) * * 2) Then, declare tracepoint loglevels for tracepoints. A diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index ac36362e..685ef5d1 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -449,8 +449,8 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))\ #undef TRACEPOINT_LOGLEVEL_ENUM #define TRACEPOINT_LOGLEVEL_ENUM(...) __VA_ARGS__ -#undef TP_LOGLEVEL -#define TP_LOGLEVEL(_identifier, _value) \ +#undef tp_loglevel +#define tp_loglevel(_identifier, _value) \ static const struct tracepoint_loglevel_enum_entry \ _TP_COMBINE_TOKENS(_TP_COMBINE_TOKENS(TRACEPOINT_PROVIDER, __tp_loglevel_enum_entry__), _identifier) = \ { \ @@ -472,8 +472,8 @@ static const struct tracepoint_loglevel_enum_entry \ #undef TRACEPOINT_LOGLEVEL_ENUM #define TRACEPOINT_LOGLEVEL_ENUM(...) __VA_ARGS__ -#undef TP_LOGLEVEL -#define TP_LOGLEVEL(_identifier, _value) \ +#undef tp_loglevel +#define tp_loglevel(_identifier, _value) \ &_TP_COMBINE_TOKENS(_TP_COMBINE_TOKENS(TRACEPOINT_PROVIDER, __tp_loglevel_enum_entry__), _identifier), static const struct tracepoint_loglevel_enum_entry *_TP_COMBINE_TOKENS(__tracepoint_loglevel_enum__, TRACEPOINT_PROVIDER)[] __attribute__((unused)) = diff --git a/tests/demo/ust_tests_demo.h b/tests/demo/ust_tests_demo.h index 9231fb71..d7493282 100644 --- a/tests/demo/ust_tests_demo.h +++ b/tests/demo/ust_tests_demo.h @@ -24,9 +24,9 @@ extern "C" { #include TRACEPOINT_LOGLEVEL_ENUM( - TP_LOGLEVEL(critical, 0) - TP_LOGLEVEL(warning, 1) - TP_LOGLEVEL(debug, 2) + tp_loglevel(critical, 0) + tp_loglevel(warning, 1) + tp_loglevel(debug, 2) ) TRACEPOINT_EVENT(ust_tests_demo, loop,