[tip:perf/core] perf trace: Only insert blank duration bracket when tracing syscalls

From: tip-bot for Arnaldo Carvalho de Melo
Date: Thu Feb 26 2015 - 06:32:32 EST


Commit-ID: 0808921a14ffa170186288508c807f2166b7d8df
Gitweb: http://git.kernel.org/tip/0808921a14ffa170186288508c807f2166b7d8df
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
AuthorDate: Thu, 19 Feb 2015 21:51:50 -0800
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
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 <adrian.hunter@xxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-jhryxgnam8zecq0q0wsy6pyb@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/