Skip to content

Commit

Permalink
perf hists: Introduce hist_entry__has_callchain() method
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jun 6, 2018
1 parent 4c50563 commit 0b5d6ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/perf/util/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0b5d6ec

Please sign in to comment.