summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChangbin Du <changbin.du@gmail.com>2020-08-08 05:31:28 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-08-14 14:54:04 +0300
commit81523c1e579bb95106e22b864fbef687d585f2b9 (patch)
tree8ea4c332492e22a440a800b42695747160d8ef43 /tools
parent846e1939801a0893ea71a6a56d8dbe2bf46682d1 (diff)
downloadlinux-81523c1e579bb95106e22b864fbef687d585f2b9.tar.xz
perf ftrace: Show trace column header
This makes 'perf ftrace' display column header before printing trace. $ sudo perf ftrace # tracer: function # # entries-in-buffer/entries-written: 0/0 #P:8 # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | <...>-9246 [006] 10726.262760: mutex_unlock <-rb_simple_write <...>-9246 [006] 10726.262764: __fsnotify_parent <-vfs_write <...>-9246 [006] 10726.262765: fsnotify <-vfs_write <...>-9246 [006] 10726.262766: __sb_end_write <-vfs_write <...>-9246 [006] 10726.262767: fpregs_assert_state_consistent <-do_syscall_64 Signed-off-by: Changbin Du <changbin.du@gmail.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: http://lore.kernel.org/lkml/20200808023141.14227-6-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-ftrace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index a3a4f4be9dde..39c694be2b71 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -435,6 +435,9 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
fcntl(trace_fd, F_SETFL, O_NONBLOCK);
pollfd.fd = trace_fd;
+ /* display column headers */
+ read_tracing_file_to_stdout("trace");
+
if (write_tracing_file("tracing_on", "1") < 0) {
pr_err("can't enable tracing\n");
goto out_close_fd;