Skip to content

Commit c421e80

Browse files
kliang2acmel
authored andcommitted
perf tools: Introduce callgraph_set for callgraph option
Introduce callgraph_set to indicate whether the callgraph option was set by user. Signed-off-by: Kan Liang <kan.liang@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1438162936-59698-4-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent ee4c758 commit c421e80

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎tools/perf/builtin-record.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,12 +762,14 @@ static void callchain_debug(void)
762762
callchain_param.dump_size);
763763
}
764764

765-
int record_parse_callchain_opt(const struct option *opt __maybe_unused,
765+
int record_parse_callchain_opt(const struct option *opt,
766766
const char *arg,
767767
int unset)
768768
{
769769
int ret;
770+
struct record_opts *record = (struct record_opts *)opt->value;
770771

772+
record->callgraph_set = true;
771773
callchain_param.enabled = !unset;
772774

773775
/* --no-call-graph */
@@ -784,10 +786,13 @@ int record_parse_callchain_opt(const struct option *opt __maybe_unused,
784786
return ret;
785787
}
786788

787-
int record_callchain_opt(const struct option *opt __maybe_unused,
789+
int record_callchain_opt(const struct option *opt,
788790
const char *arg __maybe_unused,
789791
int unset __maybe_unused)
790792
{
793+
struct record_opts *record = (struct record_opts *)opt->value;
794+
795+
record->callgraph_set = true;
791796
callchain_param.enabled = true;
792797

793798
if (callchain_param.record_mode == CALLCHAIN_NONE)

‎tools/perf/perf.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct record_opts {
5252
bool sample_weight;
5353
bool sample_time;
5454
bool sample_time_set;
55+
bool callgraph_set;
5556
bool period;
5657
bool sample_intr_regs;
5758
bool running_time;

0 commit comments

Comments
 (0)