aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo2018-12-14 10:12:09 -0300
committerArnaldo Carvalho de Melo2018-12-18 12:24:00 -0300
commite7c634fcc6ff921d725ba988cdb198ca8b59a39f (patch)
treed9e22fd8f509099fe0a16993fa4d0b05057e3924 /tools/perf/builtin-trace.c
parentac96287cae0851797262da37347b83797db931b3 (diff)
perf trace: Allow configuring if zeroed syscall args should be printed
The default so far, since we show argument names followed by its values, was to make the output more compact by suppressing most zeroed args. Make this configurable so that users can choose what best suit their needs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-q0gxws02ygodh94o0hzim5xd@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d754a74aef46..4d97bdac205c 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -127,6 +127,7 @@ struct trace {
bool show_tool_stats;
bool trace_syscalls;
bool kernel_syscallchains;
+ bool show_zeros;
bool force;
bool vfs_getname;
int trace_pgfaults;
@@ -1598,6 +1599,7 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size,
* strarray for it.
*/
if (val == 0 &&
+ !trace->show_zeros &&
!(sc->arg_fmt &&
(sc->arg_fmt[arg.idx].show_zero ||
sc->arg_fmt[arg.idx].scnprintf == SCA_STRARRAY ||
@@ -3526,14 +3528,16 @@ static void trace__set_bpf_map_syscalls(struct trace *trace)
static int trace__config(const char *var, const char *value, void *arg)
{
+ struct trace *trace = arg;
int err = 0;
if (!strcmp(var, "trace.add_events")) {
- struct trace *trace = arg;
struct option o = OPT_CALLBACK('e', "event", &trace->evlist, "event",
"event selector. use 'perf list' to list available events",
parse_events_option);
err = parse_events_option(&o, value, 0);
+ } else if (!strcmp(var, "trace.show_zeros")) {
+ trace->show_zeros = perf_config_bool(var, value);
}
return err;