Skip to content

Commit c87edb3

Browse files
committed
tracing: Fix tick_stop tracepoint symbols for user export
The symbols used in the tick_stop tracepoint were not being converted properly into integers in the trace_stop format file. Instead we had this: print fmt: "success=%d dependency=%s", REC->success, __print_symbolic(REC->dependency, { 0, "NONE" }, { (1 << TICK_DEP_BIT_POSIX_TIMER), "POSIX_TIMER" }, { (1 << TICK_DEP_BIT_PERF_EVENTS), "PERF_EVENTS" }, { (1 << TICK_DEP_BIT_SCHED), "SCHED" }, { (1 << TICK_DEP_BIT_CLOCK_UNSTABLE), "CLOCK_UNSTABLE" }) User space tools have no idea how to parse "TICK_DEP_BIT_SCHED" or the other symbols used to do the bit shifting. The reason is that the conversion was done with using the TICK_DEP_MASK_* symbols which are just macros that convert to the BIT shift itself (with the exception of NONE, which was converted properly, because it doesn't use bits, and is defined as zero). The TICK_DEP_BIT_* needs to be denoted by TRACE_DEFINE_ENUM() in order to have this properly converted for user space tools to parse this event. Cc: stable@vger.kernel.org Cc: Frederic Weisbecker <fweisbec@gmail.com> Fixes: e6e6cc2 ("nohz: Use enum code for tick stop failure tracing message") Reported-by: Luiz Capitulino <lcapitulino@redhat.com> Tested-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 7522c03 commit c87edb3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

include/trace/events/timer.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,24 +330,32 @@ TRACE_EVENT(itimer_expire,
330330
#ifdef CONFIG_NO_HZ_COMMON
331331

332332
#define TICK_DEP_NAMES \
333-
tick_dep_name(NONE) \
333+
tick_dep_mask_name(NONE) \
334334
tick_dep_name(POSIX_TIMER) \
335335
tick_dep_name(PERF_EVENTS) \
336336
tick_dep_name(SCHED) \
337337
tick_dep_name_end(CLOCK_UNSTABLE)
338338

339339
#undef tick_dep_name
340+
#undef tick_dep_mask_name
340341
#undef tick_dep_name_end
341342

342-
#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
343-
#define tick_dep_name_end(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
343+
/* The MASK will convert to their bits and they need to be processed too */
344+
#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
345+
TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
346+
#define tick_dep_name_end(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
347+
TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
348+
/* NONE only has a mask defined for it */
349+
#define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
344350

345351
TICK_DEP_NAMES
346352

347353
#undef tick_dep_name
354+
#undef tick_dep_mask_name
348355
#undef tick_dep_name_end
349356

350357
#define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
358+
#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
351359
#define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
352360

353361
#define show_tick_dep_name(val) \

0 commit comments

Comments
 (0)