Skip to contentSkip to conversation

perf trace: Don't print zeroed args

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Oct 15, 2013 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  22ae5cf1c9b4e27a3efe96d8fa6d038560a2cf23
Gitweb:     http://git.kernel.org/tip/22ae5cf1c9b4e27a3efe96d8fa6d038560a2cf23
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 12 Sep 2013 11:27:34 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 9 Oct 2013 11:11:06 -0300

perf trace: Don't print zeroed args

This way we make the output more compact.

If somebody complain (and provide a sane reason why we would like to see zeroes) we can make it an optional, ~/.perfconfig configurable knob.

Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/builtin-trace.c | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/builtin-trace.c +3 -0
index 903416c..516f6b3 100644
@@ -818,6 +818,9 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size,
 			if (arg.mask & bit)
 				continue;
 
+			if (args[arg.idx] == 0)
+				continue;
+
 			printed += scnprintf(bf + printed, size - printed,
 					     "%s%s: ", printed ? ", " : "", field->name);
 			if (sc->arg_scnprintf && sc->arg_scnprintf[arg.idx]) {