From: Johannes Berg <johannes@sipsolutions.net>
To: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH v6 2/4] tracing/timer: use __print_sym()
Date: Mon, 21 Sep 2026 12:06:33 +0200 [thread overview]
Message-ID: <20260921101538.97286-8-johannes@sipsolutions.net> (raw)
In-Reply-To: <20260921101538.97286-6-johannes@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
Use the new __print_sym() in the timer tracing, just to show
how to convert something. This adds ~80 bytes of .text for a
saving of ~1.5K of data in my builds.
Note the format changes from
print fmt: "success=%d dependency=%s", REC->success, __print_symbolic(REC->dependency, { 0, "NONE" }, { (1 << 0), "POSIX_TIMER" }, { (1 << 1), "PERF_EVENTS" }, { (1 << 2), "SCHED" }, { (1 << 3), "CLOCK_UNSTABLE" }, { (1 << 4), "RCU" }, { (1 << 5), "RCU_EXP" })
to
print fmt: "success=%d dependency=%s", REC->success, __print_symbolic(REC->dependency, { 0, "NONE" }, { 1, "POSIX_TIMER" }, { 2, "PERF_EVENTS" }, { 4, "SCHED" }, { 8, "CLOCK_UNSTABLE" }, { 16, "RCU" }, { 32, "RCU_EXP" })
since the values are now just printed in the show function as
pure decimal values.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/trace/events/timer.h | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
index ca82fd62dc30..9a43f4fedaf6 100644
--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -441,26 +441,18 @@ TRACE_EVENT(itimer_expire,
#undef tick_dep_mask_name
#undef tick_dep_name_end
-/* The MASK will convert to their bits and they need to be processed too */
-#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
- TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
-#define tick_dep_name_end(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
- TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
-/* NONE only has a mask defined for it */
-#define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
+#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
+#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
+#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
-TICK_DEP_NAMES
+TRACE_DEFINE_SYM_LIST(tick_dep_names, TICK_DEP_NAMES);
#undef tick_dep_name
#undef tick_dep_mask_name
#undef tick_dep_name_end
-#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
-#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
-#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
-
#define show_tick_dep_name(val) \
- __print_symbolic(val, TICK_DEP_NAMES)
+ __print_sym(val, tick_dep_names)
TRACE_EVENT(tick_stop,
--
2.55.0
next prev parent reply other threads:[~2026-09-21 10:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 10:06 [PATCH v6 0/4] tracing: improve symbolic printing Johannes Berg
2026-09-21 10:06 ` [PATCH v6 1/4] tracing: add __print_sym() to replace __print_symbolic() Johannes Berg
2026-09-21 10:06 ` Johannes Berg [this message]
2026-09-21 10:06 ` [PATCH v6 3/4] net: dropreason: use new __print_sym() in tracing Johannes Berg
2026-09-21 22:03 ` Matthieu Baerts
2026-09-21 22:23 ` Ilya Maximets
2026-09-21 22:36 ` Johannes Berg
2026-09-21 23:20 ` Johannes Berg
2026-09-22 9:01 ` Ilya Maximets
2026-09-22 9:03 ` Johannes Berg
2026-09-22 14:36 ` Adrián Moreno
2026-09-22 15:34 ` Aaron Conole
2026-09-22 7:18 ` Antoine Tenart
2026-09-22 8:48 ` Ilya Maximets
2026-09-22 14:35 ` Adrián Moreno
2026-09-22 14:59 ` Johannes Berg
2026-09-21 10:06 ` [PATCH v6 4/4] net: drop_monitor: use drop_reason_lookup() Johannes Berg
2026-09-21 21:59 ` [PATCH v6 0/4] tracing: improve symbolic printing Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260921101538.97286-8-johannes@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®