66 lines
2.7 KiB
Diff
66 lines
2.7 KiB
Diff
From: Steven Rostedt <rostedt@goodmis.org>
|
|
Date: Wed, 16 May 2018 09:36:45 -0400
|
|
Subject: [PATCH 3/5] tracing: Restore proper field flag printing when
|
|
displaying triggers
|
|
|
|
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
|
|
|
[ commit 608940dabe1bd2ce4c97524004ec86637cf80f2c ]
|
|
|
|
The flag-printing code used when displaying hist triggers somehow got
|
|
dropped during refactoring of the inter-event patchset. This restores
|
|
it.
|
|
|
|
Below are a couple examples - in the first case, .usecs wasn't being
|
|
displayed properly for common_timestamps and the second illustrates
|
|
the same for other flags such as .execname.
|
|
|
|
Before:
|
|
|
|
# echo 'hist:key=common_pid.execname:val=count:sort=count' > /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/trigger
|
|
# cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/trigger
|
|
hist:keys=common_pid:vals=hitcount,count:sort=count:size=2048 [active]
|
|
|
|
# echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger
|
|
# cat /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger
|
|
hist:keys=pid:vals=hitcount:ts0=common_timestamp:sort=hitcount:size=2048:clock=global if comm=="cyclictest" [active]
|
|
|
|
After:
|
|
|
|
# echo 'hist:key=common_pid.execname:val=count:sort=count' > /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/trigger
|
|
# cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_read/trigger
|
|
hist:keys=common_pid.execname:vals=hitcount,count:sort=count:size=2048 [active]
|
|
|
|
# echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger
|
|
# cat /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger
|
|
hist:keys=pid:vals=hitcount:ts0=common_timestamp.usecs:sort=hitcount:size=2048:clock=global if comm=="cyclictest" [active]
|
|
|
|
Link: http://lkml.kernel.org/r/492bab42ff21806600af98a8ea901af10efbee0c.1524790601.git.tom.zanussi@linux.intel.com
|
|
|
|
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
|
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
---
|
|
kernel/trace/trace_events_hist.c | 10 ++++++++++
|
|
1 file changed, 10 insertions(+)
|
|
|
|
--- a/kernel/trace/trace_events_hist.c
|
|
+++ b/kernel/trace/trace_events_hist.c
|
|
@@ -4867,6 +4867,16 @@ static void hist_field_print(struct seq_
|
|
seq_printf(m, "%s", field_name);
|
|
} else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)
|
|
seq_puts(m, "common_timestamp");
|
|
+
|
|
+ if (hist_field->flags) {
|
|
+ if (!(hist_field->flags & HIST_FIELD_FL_VAR_REF) &&
|
|
+ !(hist_field->flags & HIST_FIELD_FL_EXPR)) {
|
|
+ const char *flags = get_hist_field_flags(hist_field);
|
|
+
|
|
+ if (flags)
|
|
+ seq_printf(m, ".%s", flags);
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
static int event_hist_trigger_print(struct seq_file *m,
|