Skip to contentSkip to conversation

perf trace: add default value for opt 'call-graph'

PATCH In review Changbin Du 1 participant 2 messages May 3, 2020 – Jun 6, 2020 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf trace: add default value for opt 'call-graph'

The documentation says the default value of call-graph.record_mode is 'fp'. But actually we never can omit value of call-graph parameter. This patch can fix this issue.

Meanwhile, this patch adds a short name '-g' for opt 'call-graph' since it's very useful.

---
 tools/perf/builtin-trace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-trace.c +2 -2
index 01d542007c8b..21a9656021a0 100644
@@ -4754,9 +4754,9 @@ int cmd_trace(int argc, const char **argv)
 		     "Trace pagefaults", parse_pagefaults, "maj"),
 	OPT_BOOLEAN(0, "syscalls", &trace.trace_syscalls, "Trace syscalls"),
 	OPT_BOOLEAN('f', "force", &trace.force, "don't complain, do it"),
-	OPT_CALLBACK(0, "call-graph", &trace.opts,
+	OPT_CALLBACK_DEFAULT('g', "call-graph", &trace.opts,
 		     "record_mode[,record_size]", record_callchain_help,
-		     &record_parse_callchain_opt),
+		     &record_parse_callchain_opt, "fp"),
 	OPT_BOOLEAN(0, "libtraceevent_print", &trace.libtraceevent_print,
 		    "Use libtraceevent to print the tracepoint arguments."),
 	OPT_BOOLEAN(0, "kernel-syscall-graph", &trace.kernel_syscallchains,
Signature · 1 line
2.17.1
#1 lore raw

Hi Arnaldo,
Have you checked this one? thanks.

Quoted 31 lines · Changbin Du

The documentation says the default value of call-graph.record_mode is 'fp'. But actually we never can omit value of call-graph parameter. This patch can fix this issue.

Meanwhile, this patch adds a short name '-g' for opt 'call-graph' since it's very useful.

---
 tools/perf/builtin-trace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/builtin-trace.c +2 -2
index 01d542007c8b..21a9656021a0 100644
@@ -4754,9 +4754,9 @@ int cmd_trace(int argc, const char **argv)
 		     "Trace pagefaults", parse_pagefaults, "maj"),
 	OPT_BOOLEAN(0, "syscalls", &trace.trace_syscalls, "Trace syscalls"),
 	OPT_BOOLEAN('f', "force", &trace.force, "don't complain, do it"),
-	OPT_CALLBACK(0, "call-graph", &trace.opts,
+	OPT_CALLBACK_DEFAULT('g', "call-graph", &trace.opts,
 		     "record_mode[,record_size]", record_callchain_help,
-		     &record_parse_callchain_opt),
+		     &record_parse_callchain_opt, "fp"),
 	OPT_BOOLEAN(0, "libtraceevent_print", &trace.libtraceevent_print,
 		    "Use libtraceevent to print the tracepoint arguments."),
 	OPT_BOOLEAN(0, "kernel-syscall-graph", &trace.kernel_syscallchains,
Signature · 1 line
2.17.1
Signature · 2 lines
Cheers,
Changbin Du