perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 18 Apr 2016 15:30:16 +0000 (12:30 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 18 Apr 2016 15:30:16 +0000 (12:30 -0300)
One more step in the direction of using just callchain_param for
callchain parameters.

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-3b1o9kb2dc94zldz0klckti6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-top.c

index f0cfdf394fac1b8a4823cc8adca55b12f720bb4c..c130a11d3a0d7987d4720d52a0091d5ff46d5541 100644 (file)
@@ -917,15 +917,15 @@ out_err:
        return -1;
 }
 
-static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused)
+static int callchain_param__setup_sample_type(struct callchain_param *callchain)
 {
        if (!sort__has_sym) {
-               if (symbol_conf.use_callchain) {
+               if (callchain->enabled) {
                        ui__error("Selected -g but \"sym\" not present in --sort/-s.");
                        return -EINVAL;
                }
-       } else if (callchain_param.mode != CHAIN_NONE) {
-               if (callchain_register_param(&callchain_param) < 0) {
+       } else if (callchain->mode != CHAIN_NONE) {
+               if (callchain_register_param(callchain) < 0) {
                        ui__error("Can't register callchain params.\n");
                        return -EINVAL;
                }
@@ -952,7 +952,7 @@ static int __cmd_top(struct perf_top *top)
                        goto out_delete;
        }
 
-       ret = perf_top__setup_sample_type(top);
+       ret = callchain_param__setup_sample_type(&callchain_param);
        if (ret)
                goto out_delete;
 
@@ -1311,7 +1311,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 
        top.sym_evsel = perf_evlist__first(top.evlist);
 
-       if (!symbol_conf.use_callchain) {
+       if (!callchain_param.enabled) {
                symbol_conf.cumulate_callchain = false;
                perf_hpp__cancel_cumulate();
        }