aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-sched.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-05-28 15:00:29 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-06-05 09:09:54 -0400
commit27de9b2bd996de0ca4079c42c81c85158e10145c (patch)
tree98202794dad73383f1a5e865445c3c04b91d068c /tools/perf/builtin-sched.c
parent9d0199cd2a7a326510fc7f731d7974ef2fbc03d0 (diff)
perf evsel: Add has_callchain() helper to make code more compact/clear
Its common to have the (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN), so add an evsel__has_callchain(evsel) helper. This will actually get more uses as we check that instead of symbol_conf.use_callchain in places where that produces the same result but makes this decision to be more fine grained, per evsel. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-145340oytbthatpfeaq1do18@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r--tools/perf/builtin-sched.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 4dfdee668b0c..97f9e755e8e6 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -2933,8 +2933,7 @@ static int timehist_check_attr(struct perf_sched *sched,
2933 return -1; 2933 return -1;
2934 } 2934 }
2935 2935
2936 if (sched->show_callchain && 2936 if (sched->show_callchain && !evsel__has_callchain(evsel)) {
2937 !(evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN)) {
2938 pr_info("Samples do not have callchains.\n"); 2937 pr_info("Samples do not have callchains.\n");
2939 sched->show_callchain = 0; 2938 sched->show_callchain = 0;
2940 symbol_conf.use_callchain = 0; 2939 symbol_conf.use_callchain = 0;