aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.h
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2024-03-04 23:08:12 +0000
committerNamhyung Kim <[email protected]>2024-03-07 04:24:55 +0000
commitd3e7cad6f36d9e80307b05bf31959597f9b6cd62 (patch)
tree0b8212dcc1810e64d0e7f752c744b78ba3e55cc0 /tools/perf/util/annotate.h
parentperf threads: Reduce table size from 256 to 8 (diff)
downloadkernel-d3e7cad6f36d9e80307b05bf31959597f9b6cd62.tar.gz
kernel-d3e7cad6f36d9e80307b05bf31959597f9b6cd62.zip
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 <[email protected]> Reviewed-by: Arnaldo Carvalho de Melo <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Andi Kleen <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r--tools/perf/util/annotate.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 94435607c958..a2b0c8210740 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -12,6 +12,7 @@
#include "symbol_conf.h"
#include "mutex.h"
#include "spark.h"
+#include "hashmap.h"
struct hist_browser_timer;
struct hist_entry;
@@ -280,6 +281,7 @@ struct annotated_source {
size_t sizeof_sym_hist;
struct sym_hist *histograms;
struct annotation_line **offsets;
+ struct hashmap *samples;
int nr_histograms;
int nr_entries;
int nr_asm_entries;