perf annotate: Add a hashmap for symbol histogram
authorNamhyung Kim <namhyung@kernel.org>
Mon, 4 Mar 2024 23:08:12 +0000 (15:08 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 7 Mar 2024 04:24:55 +0000 (20:24 -0800)
commitd3e7cad6f36d9e80307b05bf31959597f9b6cd62
tree0b8212dcc1810e64d0e7f752c744b78ba3e55cc0
parent7bfc84b23e750d746e5c6723270b9c7f92cfa88c
perf annotate: Add a hashmap for symbol histogram

Now symbol histogram uses an array to save per-offset sample counts.
But it wastes a lot of memory if the symbol has a few samples only.
Add a hashmap to save values only for actual samples.

For now, it has duplicate histogram (one in the existing array and
another in the new hash map).  Once it can convert to use the hash
in all places, we can get rid of the array later.

Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240304230815.1440583-2-namhyung@kernel.org
tools/perf/util/annotate.c
tools/perf/util/annotate.h