perf tools: Introduce callgraph_set for callgraph option
authorKan Liang <kan.liang@intel.com>
Wed, 29 Jul 2015 09:42:12 +0000 (05:42 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 29 Jul 2015 19:18:45 +0000 (16:18 -0300)
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>
tools/perf/builtin-record.c
tools/perf/perf.h

index 445a64d..f51131b 100644 (file)
@@ -762,12 +762,14 @@ static void callchain_debug(void)
                         callchain_param.dump_size);
 }
 
-int record_parse_callchain_opt(const struct option *opt __maybe_unused,
+int record_parse_callchain_opt(const struct option *opt,
                               const char *arg,
                               int unset)
 {
        int ret;
+       struct record_opts *record = (struct record_opts *)opt->value;
 
+       record->callgraph_set = true;
        callchain_param.enabled = !unset;
 
        /* --no-call-graph */
@@ -784,10 +786,13 @@ int record_parse_callchain_opt(const struct option *opt __maybe_unused,
        return ret;
 }
 
-int record_callchain_opt(const struct option *opt __maybe_unused,
+int record_callchain_opt(const struct option *opt,
                         const char *arg __maybe_unused,
                         int unset __maybe_unused)
 {
+       struct record_opts *record = (struct record_opts *)opt->value;
+
+       record->callgraph_set = true;
        callchain_param.enabled = true;
 
        if (callchain_param.record_mode == CALLCHAIN_NONE)
index cf459f8..cccb4cf 100644 (file)
@@ -52,6 +52,7 @@ struct record_opts {
        bool         sample_weight;
        bool         sample_time;
        bool         sample_time_set;
+       bool         callgraph_set;
        bool         period;
        bool         sample_intr_regs;
        bool         running_time;