Tracepoint API namespacing 'TRACEPOINT_LOGLEVEL'
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 20 Apr 2021 17:17:11 +0000 (13:17 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Apr 2021 15:01:18 +0000 (11:01 -0400)
The ABI bump gives us the opportunity to namespace all public symbols
under the 'lttng_ust_' prefix. Namespace all API symbols and macros
under 'lttng_ust_' / 'LTTNG_UST_' and add compat macros to keep
compatibility with the previous API.

Change-Id: I3be1cdd214cfcad38613fdae0e9620f9ee8d0437
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
22 files changed:
doc/examples/demo-tracelog/demo-tracelog.c
doc/examples/demo-tracelog/demo-vtracelog.c
doc/examples/demo/ust_tests_demo.h
doc/examples/demo/ust_tests_demo2.h
doc/examples/demo/ust_tests_demo3.h
doc/examples/easy-ust/sample_component_provider.h
doc/examples/gen-tp/sample_tracepoint.tp
include/lttng/tp/lttng-ust-tracef.h
include/lttng/tp/lttng-ust-tracelog.h
include/lttng/tracelog.h
include/lttng/tracepoint-event.h
include/lttng/tracepoint.h
include/lttng/ust-tracepoint-event-reset.h
include/lttng/ust-tracepoint-event.h
src/common/tracepoint.h
src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.h
src/lib/lttng-ust-cyg-profile/lttng-ust-cyg-profile.h
src/lib/lttng-ust/lttng-events.c
src/lib/lttng-ust/lttng-probes.c
src/lib/lttng-ust/tracelog.c
tests/compile/same_line_tracepoint/ust_tests_sameline.h
tools/lttng-gen-tp

index 1950a7f4a371bc4e75cb36778d24861284670e06..5a7f0f965489e471cfc671c5a855b64a32f27cdf 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char **argv)
 
        fprintf(stderr, "Tracing... ");
        for (i = 0; i < 5; i++) {
-               tracelog(TRACE_ERR, "Error condition %d", i);
+               tracelog(LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR, "Error condition %d", i);
        }
        fprintf(stderr, " done.\n");
        return 0;
index c396a3002c7aed57faa1bf1dcc36842441976a86..05b496f561c7b5e78d832a64f04ab8689546561d 100644 (file)
@@ -20,7 +20,7 @@ void print_err(const char* msg, ...)
        va_list ap;
 
        va_start(ap, msg);
-       vtracelog(TRACE_ERR, msg, ap);
+       vtracelog(LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR, msg, ap);
        va_end(ap);
 }
 
index 7bf37c222398396f644940ec6202453b62398a99..b9384f48cc126af677971c8abda894de0853273a 100644 (file)
@@ -18,7 +18,7 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_demo, starting,
                ctf_integer(int, value, value)
        )
 )
-TRACEPOINT_LOGLEVEL(ust_tests_demo, starting, TRACE_CRIT)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(ust_tests_demo, starting, LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT)
 
 /*
  * Dummy model information, just for example. TODO: we should check if
@@ -33,7 +33,7 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_demo, done,
                ctf_integer(int, value, value)
        )
 )
-TRACEPOINT_LOGLEVEL(ust_tests_demo, done, TRACE_CRIT)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(ust_tests_demo, done, LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT)
 
 TRACEPOINT_MODEL_EMF_URI(ust_tests_demo, done,
        "http://example.com/path_to_model?q=ust_tests_demo:done")
index bdcb63260504b06f20b9a46425630d32a5d031df..a7e9abea847f50c945267ff8ab43d0835b69a83e 100644 (file)
@@ -34,7 +34,7 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_demo2, loop,
                ctf_float(double, doublefield, doublearg)
        )
 )
-TRACEPOINT_LOGLEVEL(ust_tests_demo2, loop, TRACE_WARNING)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(ust_tests_demo2, loop, LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING)
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO2_H */
 
index 0e5960e5405c9dc82f7e187399d167cdc12e2224..7ac7d9b773d04570f4d0de0a80cc91aa7155a362 100644 (file)
@@ -18,7 +18,7 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_demo3, done,
                ctf_integer(int, value, value)
        )
 )
-TRACEPOINT_LOGLEVEL(ust_tests_demo3, done, TRACE_WARNING)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(ust_tests_demo3, done, LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING)
 
 #endif /* _TRACEPOINT_UST_TESTS_DEMO3_H */
 
index 4e9327b96282b6480b5e59d6019dade9b5e3ea0d..9788180850d3e82bad2bba563781fa33b5a712ea 100644 (file)
@@ -88,13 +88,15 @@ LTTNG_UST_TRACEPOINT_EVENT(
        )
 )
 /*
- * Trace loglevel, shows the level of the trace event. It can be TRACE_EMERG,
- * TRACE_ALERT, TRACE_CRIT, TRACE_ERR, TRACE_WARNING, TRACE_INFO or others.
- * If this is not set, TRACE_DEFAULT is assumed.
- * The first two arguments identify the tracepoint
- * See details in <lttng/tracepoint.h> line 347
+ * Trace loglevel, shows the level of the trace event. It can be
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_EMERG, LTTNG_UST_TRACEPOINT_LOGLEVEL_ALERT,
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT, LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR,
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING, LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO or
+ * others.  If this is not set, LTTNG_UST_TRACEPOINT_LOGLEVEL_DEFAULT is
+ * assumed.  The first two arguments identify the tracepoint See details in
+ * <lttng/tracepoint.h> line 347
  */
-TRACEPOINT_LOGLEVEL(
+LTTNG_UST_TRACEPOINT_LOGLEVEL(
        /*
         * The provider name, must be the same as the provider name in the
         * LTTNG_UST_TRACEPOINT_EVENT and as TRACEPOINT_PROVIDER above.
@@ -109,7 +111,7 @@ TRACEPOINT_LOGLEVEL(
         * The tracepoint loglevel. Warning, some levels are abbreviated and
         * others are not, please see <lttng/tracepoint.h>
         */
-       TRACE_WARNING)
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING)
 
 #endif /* _SAMPLE_COMPONENT_PROVIDER_H */
 
index c528c35ade11ae88d7d41ff85dc3ed93beef0ee4..62489262468085d35b07a90331a41e8aa16b93e2 100644 (file)
@@ -9,7 +9,7 @@ LTTNG_UST_TRACEPOINT_EVENT(
 /*
  * Longer comments
  */
-TRACEPOINT_LOGLEVEL(
+LTTNG_UST_TRACEPOINT_LOGLEVEL(
        sample_tracepoint,
        message,
-       TRACE_WARNING)
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING)
index 393a5e0e885febea9b45c695aace560d86df53f5..1be1468c253d91729e6162631dbda5f39dc9c24b 100644 (file)
@@ -14,4 +14,4 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_tracef, event,
                ctf_unused(ip)
        )
 )
-TRACEPOINT_LOGLEVEL(lttng_ust_tracef, event, TRACE_DEBUG)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(lttng_ust_tracef, event, LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG)
index 91f40854ffe6835bba1bec4b0d127c9cec1e88a6..6aa3e8a90001a965ef40af3db56dd7da80cc9bc0 100644 (file)
@@ -24,20 +24,20 @@ LTTNG_UST_TRACEPOINT_EVENT_CLASS(lttng_ust_tracelog, tlclass,
                LTTNG_UST_TP_ARGS(const char *, file, int, line, const char *, func, \
                        const char *, msg, unsigned int, len, void *, ip) \
        ) \
-       TRACEPOINT_LOGLEVEL(lttng_ust_tracelog, _level_enum, _level_enum)
+       LTTNG_UST_TRACEPOINT_LOGLEVEL(lttng_ust_tracelog, _level_enum, _level_enum)
 
-TP_TRACELOG_TEMPLATE(TRACE_EMERG)
-TP_TRACELOG_TEMPLATE(TRACE_ALERT)
-TP_TRACELOG_TEMPLATE(TRACE_CRIT)
-TP_TRACELOG_TEMPLATE(TRACE_ERR)
-TP_TRACELOG_TEMPLATE(TRACE_WARNING)
-TP_TRACELOG_TEMPLATE(TRACE_NOTICE)
-TP_TRACELOG_TEMPLATE(TRACE_INFO)
-TP_TRACELOG_TEMPLATE(TRACE_DEBUG_SYSTEM)
-TP_TRACELOG_TEMPLATE(TRACE_DEBUG_PROGRAM)
-TP_TRACELOG_TEMPLATE(TRACE_DEBUG_PROCESS)
-TP_TRACELOG_TEMPLATE(TRACE_DEBUG_MODULE)
-TP_TRACELOG_TEMPLATE(TRACE_DEBUG_UNIT)
-TP_TRACELOG_TEMPLATE(TRACE_DEBUG_FUNCTION)
-TP_TRACELOG_TEMPLATE(TRACE_DEBUG_LINE)
-TP_TRACELOG_TEMPLATE(TRACE_DEBUG)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_EMERG)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_ALERT)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_NOTICE)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_SYSTEM)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROGRAM)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROCESS)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_MODULE)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_UNIT)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_LINE)
+TP_TRACELOG_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG)
index d997f74c24faefdefdabdc9a32261815020c7364..f20099413c4bf718de2086af9f53ce4015294146 100644 (file)
@@ -23,21 +23,21 @@ extern "C" {
                va_list ap)                                             \
                __attribute__ ((format(printf, 4, 0)));
 
-TP_TRACELOG_CB_TEMPLATE(TRACE_EMERG);
-TP_TRACELOG_CB_TEMPLATE(TRACE_ALERT);
-TP_TRACELOG_CB_TEMPLATE(TRACE_CRIT);
-TP_TRACELOG_CB_TEMPLATE(TRACE_ERR);
-TP_TRACELOG_CB_TEMPLATE(TRACE_WARNING);
-TP_TRACELOG_CB_TEMPLATE(TRACE_NOTICE);
-TP_TRACELOG_CB_TEMPLATE(TRACE_INFO);
-TP_TRACELOG_CB_TEMPLATE(TRACE_DEBUG_SYSTEM);
-TP_TRACELOG_CB_TEMPLATE(TRACE_DEBUG_PROGRAM);
-TP_TRACELOG_CB_TEMPLATE(TRACE_DEBUG_PROCESS);
-TP_TRACELOG_CB_TEMPLATE(TRACE_DEBUG_MODULE);
-TP_TRACELOG_CB_TEMPLATE(TRACE_DEBUG_UNIT);
-TP_TRACELOG_CB_TEMPLATE(TRACE_DEBUG_FUNCTION);
-TP_TRACELOG_CB_TEMPLATE(TRACE_DEBUG_LINE);
-TP_TRACELOG_CB_TEMPLATE(TRACE_DEBUG);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_EMERG);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_ALERT);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_NOTICE);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_SYSTEM);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROGRAM);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROCESS);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_MODULE);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_UNIT);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_LINE);
+TP_TRACELOG_CB_TEMPLATE(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG);
 
 #undef TP_TRACELOG_CB_TEMPLATE
 
index 30e6523dc2f3200f5e23b112f3ae69fa50d7b2fb..829e962d56a8b80f2bd802124bbfb7a5b627cf4b 100644 (file)
@@ -53,8 +53,8 @@
        LTTNG_UST__DECLARE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args))               \
        LTTNG_UST__DEFINE_TRACEPOINT(provider, name, LTTNG_UST__TP_PARAMS(args))
 
-#undef TRACEPOINT_LOGLEVEL
-#define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
+#undef LTTNG_UST_TRACEPOINT_LOGLEVEL
+#define LTTNG_UST_TRACEPOINT_LOGLEVEL(provider, name, loglevel)
 
 #undef TRACEPOINT_MODEL_EMF_URI
 #define TRACEPOINT_MODEL_EMF_URI(provider, name, uri)
index 71250ce04361be49ffd335655d2a2a278bef3e3d..8fa73ce7a55a34f5dcbd0b2179a91b8847cda934 100644 (file)
@@ -747,7 +747,7 @@ lttng_ust__tracepoints__ptrs_destroy(void)
 
 #endif /* #ifndef LTTNG_UST_TRACEPOINT_EVENT */
 
-#ifndef TRACEPOINT_LOGLEVEL
+#ifndef LTTNG_UST_TRACEPOINT_LOGLEVEL
 
 /*
  * Tracepoint Loglevels
@@ -761,85 +761,105 @@ lttng_ust__tracepoints__ptrs_destroy(void)
  * semantic. Loglevels 7 through 13 offer more fine-grained selection of
  * debug information.
  *
- * TRACE_EMERG           0
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_EMERG           0
  * system is unusable
  *
- * TRACE_ALERT           1
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_ALERT           1
  * action must be taken immediately
  *
- * TRACE_CRIT            2
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT            2
  * critical conditions
  *
- * TRACE_ERR             3
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR             3
  * error conditions
  *
- * TRACE_WARNING         4
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING         4
  * warning conditions
  *
- * TRACE_NOTICE          5
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_NOTICE          5
  * normal, but significant, condition
  *
- * TRACE_INFO            6
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO            6
  * informational message
  *
- * TRACE_DEBUG_SYSTEM    7
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_SYSTEM    7
  * debug information with system-level scope (set of programs)
  *
- * TRACE_DEBUG_PROGRAM   8
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROGRAM   8
  * debug information with program-level scope (set of processes)
  *
- * TRACE_DEBUG_PROCESS   9
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROCESS   9
  * debug information with process-level scope (set of modules)
  *
- * TRACE_DEBUG_MODULE    10
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_MODULE    10
  * debug information with module (executable/library) scope (set of units)
  *
- * TRACE_DEBUG_UNIT      11
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_UNIT      11
  * debug information with compilation unit scope (set of functions)
  *
- * TRACE_DEBUG_FUNCTION  12
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION  12
  * debug information with function-level scope
  *
- * TRACE_DEBUG_LINE      13
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_LINE      13
  * debug information with line-level scope (LTTNG_UST_TRACEPOINT_EVENT default)
  *
- * TRACE_DEBUG           14
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG           14
  * debug-level message
  *
  * Declare tracepoint loglevels for tracepoints. A LTTNG_UST_TRACEPOINT_EVENT
- * should be declared prior to the the TRACEPOINT_LOGLEVEL for a given
+ * should be declared prior to the the LTTNG_UST_TRACEPOINT_LOGLEVEL for a given
  * tracepoint name. The first field is the provider name, the second
  * field is the name of the tracepoint, the third field is the loglevel
  * name.
  *
- *      TRACEPOINT_LOGLEVEL(< [com_company_]project[_component] >, < event >,
+ *      LTTNG_UST_TRACEPOINT_LOGLEVEL(< [com_company_]project[_component] >, < event >,
  *              < loglevel_name >)
  *
  * The TRACEPOINT_PROVIDER must be already declared before declaring a
- * TRACEPOINT_LOGLEVEL.
+ * LTTNG_UST_TRACEPOINT_LOGLEVEL.
  */
 
 enum {
-       TRACE_EMERG             = 0,
-       TRACE_ALERT             = 1,
-       TRACE_CRIT              = 2,
-       TRACE_ERR               = 3,
-       TRACE_WARNING           = 4,
-       TRACE_NOTICE            = 5,
-       TRACE_INFO              = 6,
-       TRACE_DEBUG_SYSTEM      = 7,
-       TRACE_DEBUG_PROGRAM     = 8,
-       TRACE_DEBUG_PROCESS     = 9,
-       TRACE_DEBUG_MODULE      = 10,
-       TRACE_DEBUG_UNIT        = 11,
-       TRACE_DEBUG_FUNCTION    = 12,
-       TRACE_DEBUG_LINE        = 13,
-       TRACE_DEBUG             = 14,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_EMERG             = 0,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_ALERT             = 1,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT              = 2,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR               = 3,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING           = 4,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_NOTICE            = 5,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO              = 6,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_SYSTEM      = 7,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROGRAM     = 8,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROCESS     = 9,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_MODULE      = 10,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_UNIT        = 11,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION    = 12,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_LINE        = 13,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG             = 14,
 };
 
-#define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
+#define LTTNG_UST_TRACEPOINT_LOGLEVEL(provider, name, loglevel)
 
-#endif /* #ifndef TRACEPOINT_LOGLEVEL */
+#if LTTNG_UST_COMPAT_API(0)
+#define TRACEPOINT_LOGLEVEL    LTTNG_UST_TRACEPOINT_LOGLEVEL
+
+#define TRACE_EMERG            LTTNG_UST_TRACEPOINT_LOGLEVEL_EMERG
+#define TRACE_ALERT            LTTNG_UST_TRACEPOINT_LOGLEVEL_ALERT
+#define TRACE_CRIT             LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT
+#define TRACE_ERR              LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR
+#define TRACE_WARNING          LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING
+#define TRACE_NOTICE           LTTNG_UST_TRACEPOINT_LOGLEVEL_NOTICE
+#define TRACE_INFO             LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO
+#define TRACE_DEBUG_SYSTEM     LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_SYSTEM
+#define TRACE_DEBUG_PROGRAM    LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROGRAM
+#define TRACE_DEBUG_PROCESS    LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROCESS
+#define TRACE_DEBUG_MODULE     LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_MODULE
+#define TRACE_DEBUG_UNIT       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_UNIT
+#define TRACE_DEBUG_FUNCTION   LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION
+#define TRACE_DEBUG_LINE       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_LINE
+#define TRACE_DEBUG            LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG
+#endif
+
+#endif /* #ifndef LTTNG_UST_TRACEPOINT_LOGLEVEL */
 
 #ifndef TRACEPOINT_MODEL_EMF_URI
 
index a4d13b1047959cdb1668da2b7a2a471812131774..5acf5a1bd7babc2d5632e303a3c95e5ce2b5d9ce 100644 (file)
 #undef LTTNG_UST_TP_FIELDS
 #define LTTNG_UST_TP_FIELDS(...)
 
-#undef  TRACEPOINT_LOGLEVEL_ENUM
-#define TRACEPOINT_LOGLEVEL_ENUM(...)
-
-#undef TRACEPOINT_LOGLEVEL
-#define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
+#undef LTTNG_UST_TRACEPOINT_LOGLEVEL
+#define LTTNG_UST_TRACEPOINT_LOGLEVEL(provider, name, loglevel)
 
 #undef TRACEPOINT_MODEL_EMF_URI
 #define TRACEPOINT_MODEL_EMF_URI(provider, name, uri)
index fa4739ce3ec5ae05fce112105973a13b12579123..569431f1cd71847c4776ea71f46f758ad563be9c 100644 (file)
@@ -971,8 +971,8 @@ static const char __tp_event_signature___##_provider##___##_name[] =        \
 #define LTTNG_UST_TP_EXTERN_C
 #endif
 
-#undef TRACEPOINT_LOGLEVEL
-#define TRACEPOINT_LOGLEVEL(__provider, __name, __loglevel)                    \
+#undef LTTNG_UST_TRACEPOINT_LOGLEVEL
+#define LTTNG_UST_TRACEPOINT_LOGLEVEL(__provider, __name, __loglevel)                  \
 static const int _loglevel_value___##__provider##___##__name = __loglevel;     \
 LTTNG_UST_TP_EXTERN_C const int * const _loglevel___##__provider##___##__name  \
                __attribute__((visibility("hidden"))) =                         \
index 6c95ccbd463247ca86b1c8159aa2fc805f5a8914..e460995804521e3f27628530d18313a0ea300cc6 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef _UST_COMMON_TRACEPOINT_H
 #define _UST_COMMON_TRACEPOINT_H
 
-#define TRACE_DEFAULT  TRACE_DEBUG_LINE
+#define LTTNG_UST_TRACEPOINT_LOGLEVEL_DEFAULT  LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_LINE
 
 /*
  * These symbols are ABI between liblttng-ust-tracepoint and liblttng-ust,
index 81b67714a30c55890f2b8bdc1362220038db43d2..7c1d5b83df1c8274f4a381a3e383eccf0c24bc95 100644 (file)
@@ -24,8 +24,8 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_cyg_profile_fast, func_entry,
        )
 )
 
-TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile_fast, func_entry,
-       TRACE_DEBUG_FUNCTION)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile_fast, func_entry,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION)
 
 LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_cyg_profile_fast, func_exit,
        LTTNG_UST_TP_ARGS(void *, func_addr),
@@ -34,8 +34,8 @@ LTTNG_UST_TRACEPOINT_EVENT(lttng_ust_cyg_profile_fast, func_exit,
        )
 )
 
-TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile_fast, func_exit,
-       TRACE_DEBUG_FUNCTION)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile_fast, func_exit,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION)
 
 #endif /* _TRACEPOINT_LTTNG_UST_CYG_PROFILE_FAST_H */
 
index 0df21538c7952fefa80bed3d1f24eda2b2218c77..4a75c5ea3c49791273653afc2beb888cde967bbe 100644 (file)
@@ -31,16 +31,16 @@ LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(lttng_ust_cyg_profile, func_class,
        LTTNG_UST_TP_ARGS(void *, func_addr, void *, call_site)
 )
 
-TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile, func_entry,
-       TRACE_DEBUG_FUNCTION)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile, func_entry,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION)
 
 LTTNG_UST_TRACEPOINT_EVENT_INSTANCE(lttng_ust_cyg_profile, func_class,
        func_exit,
        LTTNG_UST_TP_ARGS(void *, func_addr, void *, call_site)
 )
 
-TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile, func_exit,
-       TRACE_DEBUG_FUNCTION)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(lttng_ust_cyg_profile, func_exit,
+       LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION)
 
 #endif /* _TRACEPOINT_LTTNG_UST_CYG_PROFILE_H */
 
index 33737e4d33089ff192c99c29e4c1328b018e51ad..386106136bf4ca08c15ada7913c6c32179d5576b 100644 (file)
@@ -120,23 +120,23 @@ int lttng_loglevel_match(int loglevel,
                int req_loglevel)
 {
        if (!has_loglevel)
-               loglevel = TRACE_DEFAULT;
+               loglevel = LTTNG_UST_TRACEPOINT_LOGLEVEL_DEFAULT;
        switch (req_type) {
        case LTTNG_UST_ABI_LOGLEVEL_RANGE:
                if (loglevel <= req_loglevel
-                               || (req_loglevel == -1 && loglevel <= TRACE_DEBUG))
+                               || (req_loglevel == -1 && loglevel <= LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG))
                        return 1;
                else
                        return 0;
        case LTTNG_UST_ABI_LOGLEVEL_SINGLE:
                if (loglevel == req_loglevel
-                               || (req_loglevel == -1 && loglevel <= TRACE_DEBUG))
+                               || (req_loglevel == -1 && loglevel <= LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG))
                        return 1;
                else
                        return 0;
        case LTTNG_UST_ABI_LOGLEVEL_ALL:
        default:
-               if (loglevel <= TRACE_DEBUG)
+               if (loglevel <= LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG)
                        return 1;
                else
                        return 0;
@@ -779,7 +779,7 @@ int lttng_event_recorder_create(const struct lttng_ust_event_desc *desc,
        if (desc->loglevel)
                loglevel = *(*desc->loglevel);
        else
-               loglevel = TRACE_DEFAULT;
+               loglevel = LTTNG_UST_TRACEPOINT_LOGLEVEL_DEFAULT;
        if (desc->model_emf_uri)
                uri = *(desc->model_emf_uri);
        else
index 4552e5e82880d48f800093675f3986b4f6a30cba..a0e9fffa134237ab7e67838ddeae8b028ba649bf 100644 (file)
@@ -259,7 +259,7 @@ int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list *list)
                        cds_list_add(&list_entry->head, &list->head);
                        lttng_ust_format_event_name(event_desc, list_entry->tp.name);
                        if (!event_desc->loglevel) {
-                               list_entry->tp.loglevel = TRACE_DEFAULT;
+                               list_entry->tp.loglevel = LTTNG_UST_TRACEPOINT_LOGLEVEL_DEFAULT;
                        } else {
                                list_entry->tp.loglevel = *(*event_desc->loglevel);
                        }
@@ -341,7 +341,7 @@ int lttng_probes_get_field_list(struct lttng_ust_field_list *list)
                                list_entry->field.field_name[0] = '\0';
                                list_entry->field.type = LTTNG_UST_ABI_FIELD_OTHER;
                                if (!event_desc->loglevel) {
-                                       list_entry->field.loglevel = TRACE_DEFAULT;
+                                       list_entry->field.loglevel = LTTNG_UST_TRACEPOINT_LOGLEVEL_DEFAULT;
                                } else {
                                        list_entry->field.loglevel = *(*event_desc->loglevel);
                                }
@@ -394,7 +394,7 @@ int lttng_probes_get_field_list(struct lttng_ust_field_list *list)
                                        list_entry->field.type = LTTNG_UST_ABI_FIELD_OTHER;
                                }
                                if (!event_desc->loglevel) {
-                                       list_entry->field.loglevel = TRACE_DEFAULT;
+                                       list_entry->field.loglevel = LTTNG_UST_TRACEPOINT_LOGLEVEL_DEFAULT;
                                } else {
                                        list_entry->field.loglevel = *(*event_desc->loglevel);
                                }
index f506e8aef080fb884315fa8ae1ea8f76ad4757d7..e5bd3890ff5157107772c77ee91e611e752a3792 100644 (file)
                va_end(ap); \
        }
 
-TRACELOG_CB(TRACE_EMERG)
-TRACELOG_CB(TRACE_ALERT)
-TRACELOG_CB(TRACE_CRIT)
-TRACELOG_CB(TRACE_ERR)
-TRACELOG_CB(TRACE_WARNING)
-TRACELOG_CB(TRACE_NOTICE)
-TRACELOG_CB(TRACE_INFO)
-TRACELOG_CB(TRACE_DEBUG_SYSTEM)
-TRACELOG_CB(TRACE_DEBUG_PROGRAM)
-TRACELOG_CB(TRACE_DEBUG_PROCESS)
-TRACELOG_CB(TRACE_DEBUG_MODULE)
-TRACELOG_CB(TRACE_DEBUG_UNIT)
-TRACELOG_CB(TRACE_DEBUG_FUNCTION)
-TRACELOG_CB(TRACE_DEBUG_LINE)
-TRACELOG_CB(TRACE_DEBUG)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_EMERG)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_ALERT)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_CRIT)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_NOTICE)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_SYSTEM)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROGRAM)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_PROCESS)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_MODULE)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_UNIT)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_FUNCTION)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_LINE)
+TRACELOG_CB(LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG)
index 5efd48085607b9b54ced04f2cff54d10e191b887..ba76c1a23e376ee601a4db6defb24ef773f3838a 100644 (file)
@@ -16,13 +16,13 @@ LTTNG_UST_TRACEPOINT_EVENT(ust_tests_sameline, event1,
        LTTNG_UST_TP_ARGS(),
        LTTNG_UST_TP_FIELDS()
 )
-TRACEPOINT_LOGLEVEL(ust_tests_sameline, event1, TRACE_CRIT)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(ust_tests_sameline, event1, TRACE_CRIT)
 
 LTTNG_UST_TRACEPOINT_EVENT(ust_tests_sameline, event2,
        LTTNG_UST_TP_ARGS(),
        LTTNG_UST_TP_FIELDS()
 )
-TRACEPOINT_LOGLEVEL(ust_tests_sameline, event2, TRACE_CRIT)
+LTTNG_UST_TRACEPOINT_LOGLEVEL(ust_tests_sameline, event2, TRACE_CRIT)
 
 #endif /* _TRACEPOINT_UST_TESTS_SAMELINE_H */
 
index b318d1cdcf8c592e8db6ff399b7d0125cd929ead..c3ee7c5e13d84fbc0655fe136f2741aba8b231e3 100755 (executable)
@@ -170,7 +170,7 @@ class TemplateFile:
         cleantext = re.sub("\s*", "", nolinecomment)
         # Remove multine C style comments
         nocomment = re.sub("/\*.*?\*/", "", cleantext)
-        entries = re.split("LTTNG_UST_TRACEPOINT_.*?", nocomment)
+        entries = re.split("^LTTNG_UST_TRACEPOINT_.*?", nocomment)
 
         for entry in entries:
             if entry != '':
@@ -200,7 +200,7 @@ usage = """
  When using the -o option, the OUTPUT_FILE must end with either .h, .c or .o
  The -o option can be repeated multiple times.
 
- The template file must contains LTTNG_UST_TRACEPOINT_EVENT and TRACEPOINT_LOGLEVEL
+ The template file must contains LTTNG_UST_TRACEPOINT_EVENT and LTTNG_UST_TRACEPOINT_LOGLEVEL
  as per defined in the lttng/tracepoint.h file.
  See the lttng-ust(3) man page for more details on the format.
 """
This page took 0.042056 seconds and 4 git commands to generate.