perf hists: Save the callchain_size in struct hist_entry
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 7 Jun 2018 17:19:54 +0000 (14:19 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 7 Jun 2018 17:22:53 +0000 (14:22 -0300)
commit41477acf092251eb0cfe83068f48dbcb2521478a
treee3613b2fdb0bc290666b0351107be8a7644ebfd2
parent2696ec4566f598ab483a6bebc4ec841b2efb88ec
perf hists: Save the callchain_size in struct hist_entry

So that we can figure out the real size of the struct and also be able
to tell if callchains may be present in this histogram entry.

Since we can't always guarantee that from hist_entry->hists we can use
hists_to_evsel, to then look at evsel->attr.sample_type for
PERF_SAMPLE_CALLCHAIN, like with the 'perf c2c' tool, that uses plain
'struct hists' instances, we need another way of deciding if a specific
hist_entry instance has callchains associated with it, i.e. if its
hist_entry->callchain[0] has space allocated for.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.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-ptvndealxs1k7myluvu9flnq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/hist.c
tools/perf/util/sort.h