From 8a920d4d1601cd7b85d876d0f31381bf0961ae6f Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 10 Jun 2015 08:54:37 +0200 Subject: [PATCH] tracelog: use same class for all loglevels 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 --- include/lttng/lttng-ust-tracelog.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/include/lttng/lttng-ust-tracelog.h b/include/lttng/lttng-ust-tracelog.h index 50b8054b..5bd35158 100644 --- a/include/lttng/lttng-ust-tracelog.h +++ b/include/lttng/lttng-ust-tracelog.h @@ -23,16 +23,21 @@ #include #include +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) -- 2.34.1