lkml.org 
[lkml]   [2020]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 07/15] perf ftrace: show trace column header
On Fri, Jul 03, 2020 at 03:20:15PM +0900, Namhyung Kim wrote:
> On Sat, Jun 27, 2020 at 10:38 PM Changbin Du <changbin.du@gmail.com> wrote:
> >
> > 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
>
> You'd better indent the example output by 2 spaces to prevent
> the # signs commented out.
>
okay. I even didn't know this recipe befoe so I add a '\' :). Thanks.

> Thanks
> Namhyung
>
>
> >
> > Signed-off-by: Changbin Du <changbin.du@gmail.com>
> > ---
> > tools/perf/builtin-ftrace.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
> > index e45496012611..686d744d5025 100644
> > --- a/tools/perf/builtin-ftrace.c
> > +++ b/tools/perf/builtin-ftrace.c
> > @@ -430,6 +430,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 (!ftrace->initial_delay) {
> > if (write_tracing_file("tracing_on", "1") < 0) {
> > pr_err("can't enable tracing\n");
> > --
> > 2.25.1
> >

--
Cheers,
Changbin Du

\
 
 \ /
  Last update: 2020-07-07 16:06    [W:0.256 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site