aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/sort.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-06-07 14:27:19 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-06-07 14:27:19 -0300
commite5654455795f2f89328f7b301dacb6926e57e2b8 (patch)
tree7693f6960bc2fd3cc6ee57f1a8a1885ae6485ad5 /tools/perf/util/sort.h
parentperf hists: Save the callchain_size in struct hist_entry (diff)
downloadlinux-dev-e5654455795f2f89328f7b301dacb6926e57e2b8.tar.xz
linux-dev-e5654455795f2f89328f7b301dacb6926e57e2b8.zip
perf hists: Make hist_entry__has_callchains() work with 'perf c2c'
Since 'perf c2c' uses 'struct hists' not allocated together with a 'struct perf_evsel' instance, we can't go from a 'struct hist_entry' pointer to a 'struct perf_evsel' via he->hists, so, instead, check if space was set aside for hist_entry->callchain[0] at hist_entry__new() time. Reported-by: Jin Yao <yao.jin@linux.intel.com> Reported-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Fixes: fabd37b837f6 ("perf hists: Check if a hist_entry has callchains before using them") Link: https://lkml.kernel.org/n/tip-e8ife8djvvvwmeze3s4yodii@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/sort.h')
-rw-r--r--tools/perf/util/sort.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 9ab9257ed887..8bf302cafcec 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -155,7 +155,7 @@ struct hist_entry {
static __pure inline bool hist_entry__has_callchains(struct hist_entry *he)
{
- return hists__has_callchains(he->hists);
+ return he->callchain_size != 0;
}
static inline bool hist_entry__has_pairs(struct hist_entry *he)