From: Mathieu Desnoyers Date: Fri, 11 Nov 2011 17:31:35 +0000 (-0500) Subject: Tracepoint API change: rename TRACEPOINT_SYSTEM to TRACEPOINT_PROVIDER X-Git-Tag: v1.9.1~108 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a4ada9b87a62c26061c109abe0fd502e16f03db2;p=lttng-ust.git Tracepoint API change: rename TRACEPOINT_SYSTEM to TRACEPOINT_PROVIDER Eliminates the confusion between the first TRACEPOINT_EVENT "provider" argument and the "TRACEPOINT_SYSTEM", which need to be the same thing. Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint-event.h b/include/lttng/tracepoint-event.h index a102ce74..686db1e3 100644 --- a/include/lttng/tracepoint-event.h +++ b/include/lttng/tracepoint-event.h @@ -21,11 +21,11 @@ * in their file should include this file. The following are macros that the * trace file may define: * - * TRACEPOINT_SYSTEM defines the system the tracepoint is for: + * TRACEPOINT_PROVIDER defines the provider the tracepoint is for: * < [com_company_]project_[component_] > * * TRACEPOINT_INCLUDE_FILE if the file name is something other than - * TRACEPOINT_SYSTEM.h. This macro may be defined to tell + * TRACEPOINT_PROVIDER.h. This macro may be defined to tell * define_trace.h what file to include. Note, leave off the ".h". * * TRACEPOINT_INCLUDE_PATH if the path is something other than within @@ -71,19 +71,19 @@ extern "C" { #undef __TRACEPOINT_INCLUDE #ifndef TRACEPOINT_INCLUDE_FILE -# define TRACEPOINT_INCLUDE_FILE TRACEPOINT_SYSTEM +# define TRACEPOINT_INCLUDE_FILE TRACEPOINT_PROVIDER # define UNDEF_TRACEPOINT_INCLUDE_FILE #endif #ifndef TRACEPOINT_INCLUDE_PATH -# define __TRACEPOINT_INCLUDE(system) +# define __TRACEPOINT_INCLUDE(provider) # define UNDEF_TRACEPOINT_INCLUDE_PATH #else -# define __TRACEPOINT_INCLUDE(system) \ - __tp_stringify(TRACEPOINT_INCLUDE_PATH/system.h) +# define __TRACEPOINT_INCLUDE(provider) \ + __tp_stringify(TRACEPOINT_INCLUDE_PATH/provider.h) #endif -# define TRACEPOINT_INCLUDE(system) __TRACEPOINT_INCLUDE(system) +# define TRACEPOINT_INCLUDE(provider) __TRACEPOINT_INCLUDE(provider) /* Let the trace headers be reread */ #define TRACEPOINT_HEADER_MULTI_READ diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index e44c0331..f4d7d609 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -326,7 +326,7 @@ static void __attribute__((destructor)) __tracepoints__destroy(void) * Do _NOT_ add comma (,) nor semicolon (;) after the TRACEPOINT_EVENT * declaration. * - * The TRACEPOINT_SYSTEM must be defined when declaring a + * The TRACEPOINT_PROVIDER must be defined when declaring a * TRACEPOINT_EVENT. See ust/tracepoint-event.h for information about * usage of other macros controlling TRACEPOINT_EVENT. */ @@ -395,11 +395,11 @@ static void __attribute__((destructor)) __tracepoints__destroy(void) * TRACEPOINT_LOGLEVEL(< [com_company_]project[_component] >, < event >, * < loglevel_name >) * - * The TRACEPOINT_SYSTEM must be defined when declaring a + * The TRACEPOINT_PROVIDER must be defined when declaring a * TRACEPOINT_LOGLEVEL_ENUM and TRACEPOINT_LOGLEVEL. The tracepoint - * loglevel enumeration apply to the entire TRACEPOINT_SYSTEM. Only one + * loglevel enumeration apply to the entire TRACEPOINT_PROVIDER. Only one * tracepoint loglevel enumeration should be declared per tracepoint - * system. + * provider. */ #define TRACEPOINT_LOGLEVEL_ENUM() diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 901f4917..a60149e0 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -226,10 +226,10 @@ static void __event_probe__##_provider##___##_name(void *__data); #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _proto, _args) \ TRACEPOINT_EVENT_INSTANCE_NOARGS(_provider, _template, _name) -#define TP_ID1(_token, _system) _token##_system -#define TP_ID(_token, _system) TP_ID1(_token, _system) +#define TP_ID1(_token, _provider) _token##_provider +#define TP_ID(_token, _provider) TP_ID1(_token, _provider) -static const struct lttng_event_desc TP_ID(__event_desc___, TRACEPOINT_SYSTEM)[] = { +static const struct lttng_event_desc TP_ID(__event_desc___, TRACEPOINT_PROVIDER)[] = { #include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE) }; @@ -243,13 +243,13 @@ static const struct lttng_event_desc TP_ID(__event_desc___, TRACEPOINT_SYSTEM)[] * Create a toplevel descriptor for the whole probe. */ -#define TP_ID1(_token, _system) _token##_system -#define TP_ID(_token, _system) TP_ID1(_token, _system) +#define TP_ID1(_token, _provider) _token##_provider +#define TP_ID(_token, _provider) TP_ID1(_token, _provider) /* non-const because list head will be modified when registered. */ -static struct lttng_probe_desc TP_ID(__probe_desc___, TRACEPOINT_SYSTEM) = { - .event_desc = TP_ID(__event_desc___, TRACEPOINT_SYSTEM), - .nr_events = _TP_ARRAY_SIZE(TP_ID(__event_desc___, TRACEPOINT_SYSTEM)), +static struct lttng_probe_desc TP_ID(__probe_desc___, TRACEPOINT_PROVIDER) = { + .event_desc = TP_ID(__event_desc___, TRACEPOINT_PROVIDER), + .nr_events = _TP_ARRAY_SIZE(TP_ID(__event_desc___, TRACEPOINT_PROVIDER)), }; #undef TP_ID1 @@ -498,22 +498,22 @@ static void __event_probe__##_provider##___##_name(void *__data) \ /* Reset all macros within TRACEPOINT_EVENT */ #include -#define TP_ID1(_token, _system) _token##_system -#define TP_ID(_token, _system) TP_ID1(_token, _system) +#define TP_ID1(_token, _provider) _token##_provider +#define TP_ID(_token, _provider) TP_ID1(_token, _provider) static void __attribute__((constructor)) -TP_ID(__lttng_events_init__, TRACEPOINT_SYSTEM)(void) +TP_ID(__lttng_events_init__, TRACEPOINT_PROVIDER)(void) { int ret; - ret = ltt_probe_register(&TP_ID(__probe_desc___, TRACEPOINT_SYSTEM)); + ret = ltt_probe_register(&TP_ID(__probe_desc___, TRACEPOINT_PROVIDER)); assert(!ret); } static void __attribute__((destructor)) -TP_ID(__lttng_events_exit__, TRACEPOINT_SYSTEM)(void) +TP_ID(__lttng_events_exit__, TRACEPOINT_PROVIDER)(void) { - ltt_probe_unregister(&TP_ID(__probe_desc___, TRACEPOINT_SYSTEM)); + ltt_probe_unregister(&TP_ID(__probe_desc___, TRACEPOINT_PROVIDER)); } #undef TP_ID1 diff --git a/liblttng-ust-java/lttng_ust_java.h b/liblttng-ust-java/lttng_ust_java.h index 67e8d2d7..3e2eb045 100644 --- a/liblttng-ust-java/lttng_ust_java.h +++ b/liblttng-ust-java/lttng_ust_java.h @@ -1,8 +1,8 @@ -#undef TRACEPOINT_SYSTEM -#define TRACEPOINT_SYSTEM ust_java +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER lttng_ust_java -#if !defined(_TRACEPOINT_UST_JAVA_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_UST_JAVA_H +#if !defined(_TRACEPOINT_LTTNG_UST_JAVA_H) || defined(TRACEPOINT_HEADER_MULTI_READ) +#define _TRACEPOINT_LTTNG_UST_JAVA_H /* * Copyright (C) 2011 Mathieu Desnoyers @@ -24,7 +24,7 @@ #include -TRACEPOINT_EVENT(lttng_ust_java_string, +TRACEPOINT_EVENT(lttng_ust_java, string, TP_PROTO(const char *name, const char *args), TP_VARS(name, args), TP_FIELDS( @@ -33,7 +33,7 @@ TRACEPOINT_EVENT(lttng_ust_java_string, ) ) -#endif /* _TRACEPOINT_UST_JAVA_H */ +#endif /* _TRACEPOINT_LTTNG_UST_JAVA_H */ #undef TRACEPOINT_INCLUDE_PATH #define TRACEPOINT_INCLUDE_PATH . diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index ea0a1248..6a60532d 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -322,7 +322,7 @@ void lttng_metadata_create_events(int channel_objd) struct ltt_channel *channel = objd_private(channel_objd); static struct lttng_ust_event metadata_params = { .instrumentation = LTTNG_UST_TRACEPOINT, - .name = "lttng:metadata", + .name = "lttng_ust:metadata", }; struct ltt_event *event; @@ -513,7 +513,8 @@ copy: if (!list->iter.tracepoint) { tp_list_entry[0] = '\0'; /* end of list */ } else { - if (!strcmp((*list->iter.tracepoint)->name, "lttng:metadata")) + if (!strcmp((*list->iter.tracepoint)->name, + "lttng_ust:metadata")) goto next; memcpy(tp_list_entry, (*list->iter.tracepoint)->name, LTTNG_UST_SYM_NAME_LEN); diff --git a/liblttng-ust/probes/lttng-probe-ust.h b/liblttng-ust/probes/lttng-probe-ust.h index c8525fd9..3ae9e020 100644 --- a/liblttng-ust/probes/lttng-probe-ust.h +++ b/liblttng-ust/probes/lttng-probe-ust.h @@ -1,5 +1,5 @@ -#undef TRACEPOINT_SYSTEM -#define TRACEPOINT_SYSTEM lttng_ust +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER lttng_ust #if !defined(_TRACEPOINT_LTTNG_UST_H) || defined(TRACEPOINT_HEADER_MULTI_READ) #define _TRACEPOINT_LTTNG_UST_H @@ -24,7 +24,7 @@ #include -TRACEPOINT_EVENT(lttng, metadata, +TRACEPOINT_EVENT(lttng_ust, metadata, TP_PROTO(const char *str), diff --git a/tests/fork/ust_tests_fork.h b/tests/fork/ust_tests_fork.h index f86df70a..4e078911 100644 --- a/tests/fork/ust_tests_fork.h +++ b/tests/fork/ust_tests_fork.h @@ -1,5 +1,5 @@ -#undef TRACEPOINT_SYSTEM -#define TRACEPOINT_SYSTEM ust_tests_fork +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER ust_tests_fork #if !defined(_TRACEPOINT_UST_TESTS_FORK_H) || defined(TRACEPOINT_HEADER_MULTI_READ) #define _TRACEPOINT_UST_TESTS_FORK_H diff --git a/tests/hello/ust_tests_hello.h b/tests/hello/ust_tests_hello.h index 9f38e983..86e4ce7d 100644 --- a/tests/hello/ust_tests_hello.h +++ b/tests/hello/ust_tests_hello.h @@ -1,5 +1,5 @@ -#undef TRACEPOINT_SYSTEM -#define TRACEPOINT_SYSTEM ust_tests_hello +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER ust_tests_hello #if !defined(_TRACEPOINT_UST_TESTS_HELLO_H) || defined(TRACEPOINT_HEADER_MULTI_READ) #define _TRACEPOINT_UST_TESTS_HELLO_H