tracelog: use same class for all loglevels
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Jun 2015 06:54:37 +0000 (08:54 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 10 Jun 2015 06:54:37 +0000 (08:54 +0200)
Each loglevel can be serialized by the exact same serialization
function. Therefore, use a single tracepoint class for all those.

This diminishes the code size of the probe, and therefore its impact on
the instruction cache.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/lttng-ust-tracelog.h

index 50b8054b15be6e1495af5b5b17bd02dcac48b97f..5bd351589a020ce3f35165fbb74999b48884b3a6 100644 (file)
 #include <lttng/tracepoint.h>
 #include <stdarg.h>
 
+TRACEPOINT_EVENT_CLASS(lttng_ust_tracelog, tlclass,
+       TP_ARGS(const char *, file, int, line, const char *, func,
+               const char *, msg, unsigned int, len, void *, ip),
+       TP_FIELDS(
+               ctf_integer(int, line, line)
+               ctf_string(file, file)
+               ctf_string(func, func)
+               ctf_sequence_text(char, msg, msg, unsigned int, len)
+       )
+)
+
 #define TP_TRACELOG_TEMPLATE(_level_enum) \
-       TRACEPOINT_EVENT(lttng_ust_tracelog, _level_enum, \
+       TRACEPOINT_EVENT_INSTANCE(lttng_ust_tracelog, tlclass, _level_enum, \
                TP_ARGS(const char *, file, int, line, const char *, func, \
-                       const char *, msg, unsigned int, len, void *, ip), \
-               TP_FIELDS( \
-                       ctf_integer(int, line, line) \
-                       ctf_string(file, file) \
-                       ctf_string(func, func) \
-                       ctf_sequence_text(char, msg, msg, unsigned int, len) \
-               ) \
+                       const char *, msg, unsigned int, len, void *, ip) \
        ) \
        TRACEPOINT_LOGLEVEL(lttng_ust_tracelog, _level_enum, _level_enum)
 
This page took 0.024842 seconds and 4 git commands to generate.