[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20180111141657.14000-1-tmricht@linux.vnet.ibm.com>
Date: Thu, 11 Jan 2018 15:16:57 +0100
From: Thomas Richter <tmricht@...ux.vnet.ibm.com>
To: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
acme@...nel.org
Cc: brueckner@...ux.vnet.ibm.com, schwidefsky@...ibm.com,
heiko.carstens@...ibm.com,
Thomas Richter <tmricht@...ux.vnet.ibm.com>
Subject: [PATCH] perf trace: Warn about --call-graph dwarf invalid parameters
When invoking ./perf trace --call-graph fp|lbr with
additional parameters a warning is printed that these
additional comma separated parameters are silently ignored.
[root@f27 perf]# ./perf trace -vv --no-syscalls --call-graph lbr,1024
callchain: No more arguments needed for --call-graph lbr
[root@f27 perf]#
This does not happen for --call-graph dwarf,4096,4. The additional
parameter 4 is silently ignored and no warning printed.
Before:
[root@f27 perf]# ./perf trace --no-syscalls --call-graph dwarf,4096,4
Please specify something to trace.
[root@f27 perf]#
After:
[root@...lp76 perf]# ./perf trace --no-syscalls --call-graph dwarf,4096,4
callchain: No more arguments needed for --call-graph dwarf[,xxx]
Please specify something to trace.
[root@...lp76 perf]#
Signed-off-by: Thomas Richter <tmricht@...ux.vnet.ibm.com>
---
tools/perf/util/callchain.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 082505d08d72..59292d582894 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -272,6 +272,10 @@ int parse_callchain_record(const char *arg, struct callchain_param *param)
ret = get_stack_size(tok, &size);
param->dump_size = size;
+ if (strtok_r(NULL, ",", &saveptr)) {
+ pr_err("callchain: No more arguments "
+ "needed for --call-graph dwarf[,xxx]\n");
+ }
}
} else if (!strncmp(name, "lbr", sizeof("lbr"))) {
if (!strtok_r(NULL, ",", &saveptr)) {
--
2.13.4
Powered by blists - more mailing lists