diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2018-04-26 21:04:47 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-04-26 21:38:43 -0400 |
commit | 608940dabe1bd2ce4c97524004ec86637cf80f2c (patch) | |
tree | 92be712fbb54846e09c3bc9286a2203ec6fbd522 | |
parent | 0566e40ce7c493d39006cdd7edf17bfdc52eb2ac (diff) |
tracing: Restore proper field flag printing when displaying triggers
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>
-rw-r--r-- | kernel/trace/trace_events_hist.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 0d7b3ffbecc2..66c87be4ebb2 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c | |||
@@ -4913,6 +4913,16 @@ static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) | |||
4913 | seq_printf(m, "%s", field_name); | 4913 | seq_printf(m, "%s", field_name); |
4914 | } else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) | 4914 | } else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) |
4915 | seq_puts(m, "common_timestamp"); | 4915 | seq_puts(m, "common_timestamp"); |
4916 | |||
4917 | if (hist_field->flags) { | ||
4918 | if (!(hist_field->flags & HIST_FIELD_FL_VAR_REF) && | ||
4919 | !(hist_field->flags & HIST_FIELD_FL_EXPR)) { | ||
4920 | const char *flags = get_hist_field_flags(hist_field); | ||
4921 | |||
4922 | if (flags) | ||
4923 | seq_printf(m, ".%s", flags); | ||
4924 | } | ||
4925 | } | ||
4916 | } | 4926 | } |
4917 | 4927 | ||
4918 | static int event_hist_trigger_print(struct seq_file *m, | 4928 | static int event_hist_trigger_print(struct seq_file *m, |