Commit-ID:  0808921a14ffa170186288508c807f2166b7d8df
Gitweb:     http://git.kernel.org/tip/0808921a14ffa170186288508c807f2166b7d8df
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 19 Feb 2015 21:51:50 -0800
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sun, 22 Feb 2015 22:13:54 -0300

perf trace: Only insert blank duration bracket when tracing syscalls

When printing just events, i.e. '--no-sys --ev some:events' it makes no
sense to waste screen space.

Before:

 # trace --no-sys --ev probe:*
 84481.704 (         ): probe:vfs_getname:(ffffffff811ed023) 
pathname="/etc/services")
 84481.892 (         ): probe:vfs_getname:(ffffffff811ed023) 
pathname="/etc/services")
 84482.230 (         ): probe:vfs_getname:(ffffffff811ed023) 
pathname="/etc/resolv.conf")
 84482.481 (         ): probe:vfs_getname:(ffffffff811ed023) 
pathname="/etc/hosts")
 85097.725 (         ): probe:vfs_getname:(ffffffff811ed023) pathname="/root"
 #

After:

 # trace --no-sys --ev probe:*
 0.000 probe:vfs_getname:(ffffffff811ed023) pathname="/root")
 1.711 probe:vfs_getname:(ffffffff811ed023) pathname="/etc/localtime")
 2.103 probe:vfs_getname:(ffffffff811ed023) pathname="/etc/localtime")
^C#

Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/builtin-trace.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index b1c1df9..3a696aa 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1840,7 +1840,11 @@ static int trace__event_handler(struct trace *trace, 
struct perf_evsel *evsel,
 {
        trace__printf_interrupted_entry(trace, sample);
        trace__fprintf_tstamp(trace, sample->time, trace->output);
-       fprintf(trace->output, "(%9.9s): %s:", " ", evsel->name);
+
+       if (trace->trace_syscalls)
+               fprintf(trace->output, "(         ): ");
+
+       fprintf(trace->output, "%s:", evsel->name);
 
        if (evsel->tp_format) {
                event_format__fprintf(evsel->tp_format, sample->cpu,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to