perf report: Use callchain_param.enabled instead of tool specific knob

We have callchain_param.enabled, so no need to have something just for
'perf report' to do the same thing.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-wbeisubpualwogwi5u8utnt1@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 30234f09
...@@ -47,7 +47,6 @@ struct report { ...@@ -47,7 +47,6 @@ struct report {
struct perf_tool tool; struct perf_tool tool;
struct perf_session *session; struct perf_session *session;
bool use_tui, use_gtk, use_stdio; bool use_tui, use_gtk, use_stdio;
bool dont_use_callchains;
bool show_full_info; bool show_full_info;
bool show_threads; bool show_threads;
bool inverted_callchain; bool inverted_callchain;
...@@ -247,7 +246,7 @@ static int report__setup_sample_type(struct report *rep) ...@@ -247,7 +246,7 @@ static int report__setup_sample_type(struct report *rep)
"you call 'perf record' without -g?\n"); "you call 'perf record' without -g?\n");
return -1; return -1;
} }
} else if (!rep->dont_use_callchains && } else if (!callchain_param.enabled &&
callchain_param.mode != CHAIN_NONE && callchain_param.mode != CHAIN_NONE &&
!symbol_conf.use_callchain) { !symbol_conf.use_callchain) {
symbol_conf.use_callchain = true; symbol_conf.use_callchain = true;
...@@ -599,13 +598,15 @@ static int __cmd_report(struct report *rep) ...@@ -599,13 +598,15 @@ static int __cmd_report(struct report *rep)
static int static int
report_parse_callchain_opt(const struct option *opt, const char *arg, int unset) report_parse_callchain_opt(const struct option *opt, const char *arg, int unset)
{ {
struct report *rep = (struct report *)opt->value; struct callchain_param *callchain = opt->value;
callchain->enabled = !unset;
/* /*
* --no-call-graph * --no-call-graph
*/ */
if (unset) { if (unset) {
rep->dont_use_callchains = true; symbol_conf.use_callchain = false;
callchain->mode = CHAIN_NONE;
return 0; return 0;
} }
...@@ -734,7 +735,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) ...@@ -734,7 +735,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
"regex filter to identify parent, see: '--sort parent'"), "regex filter to identify parent, see: '--sort parent'"),
OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other, OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
"Only display entries with parent-match"), "Only display entries with parent-match"),
OPT_CALLBACK_DEFAULT('g', "call-graph", &report, OPT_CALLBACK_DEFAULT('g', "call-graph", &callchain_param,
"print_type,threshold[,print_limit],order,sort_key[,branch],value", "print_type,threshold[,print_limit],order,sort_key[,branch],value",
report_callchain_help, &report_parse_callchain_opt, report_callchain_help, &report_parse_callchain_opt,
callchain_default_opt), callchain_default_opt),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册