diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-29 18:28:24 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-06-06 17:51:46 +0200 |
commit | 0b5d6ece5e6a8b45c4ebbaaf831675b5b605850f (patch) | |
tree | 0e7a9ebf9f996b85dd1623cdb4d85173016e3488 /tools/perf | |
parent | perf sched: Use sched->show_callchain where appropriate (diff) | |
download | linux-0b5d6ece5e6a8b45c4ebbaaf831675b5b605850f.tar.xz linux-0b5d6ece5e6a8b45c4ebbaaf831675b5b605850f.zip |
perf hists: Introduce hist_entry__has_callchain() method
We'll use this helper more frequently when reworking
symbol_conf.use_callchain logic, where knowing if a hist_entry has
callchains is the important bit, so make going from hist_entry to hists
to evsel easier, compact.
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-p6gioxkzpkpz71dtt4wcs36o@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/sort.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index f007a26d6f6d..1a046157bfef 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -151,6 +151,12 @@ struct hist_entry { struct callchain_root callchain[0]; /* must be last member */ }; +static __pure inline bool hist_entry__has_callchains(struct hist_entry *he) +{ + const struct perf_evsel *evsel = hists_to_evsel(he->hists); + return evsel__has_callchain(evsel); +} + static inline bool hist_entry__has_pairs(struct hist_entry *he) { return !list_empty(&he->pairs.node); |