linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf trace: Warn about --call-graph dwarf invalid parameters
@ 2018-01-11 14:16 Thomas Richter
  0 siblings, 0 replies; only message in thread
From: Thomas Richter @ 2018-01-11 14:16 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme
  Cc: brueckner, schwidefsky, heiko.carstens, Thomas Richter

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@s35lp76 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@s35lp76 perf]#

Signed-off-by: Thomas Richter <tmricht@linux.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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-11 14:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-11 14:16 [PATCH] perf trace: Warn about --call-graph dwarf invalid parameters Thomas Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).