diff options
author | Namhyung Kim <namhyung@kernel.org> | 2024-04-04 10:57:15 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-04-08 17:43:20 -0300 |
commit | 6f94a72d45295741b8be64da40a86780c7681a3b (patch) | |
tree | fc711b4328c422e49429c09f248bcf80cf67904c /tools/perf/util/annotate.h | |
parent | f6b18ababa5ea8d7f798aa452eae83058fd09c59 (diff) |
perf annotate: Move nr_events struct to 'struct annotated_source'
It's only used in 'perf annotate' output which means functions with actual
samples. No need to consume memory for every symbol ('struct annotation').
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240404175716.1225482-9-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r-- | tools/perf/util/annotate.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 382705311d28..d22b9e9a2fad 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -247,6 +247,7 @@ struct cyc_hist { * to see each group separately, that is why symbol__annotate2() * sets src->nr_histograms to evsel->nr_members. * @samples: Hash map of sym_hist_entry. Keyed by event index and offset in symbol. + * @nr_events: Number of events in the current output. * @nr_entries: Number of annotated_line in the source list. * @nr_asm_entries: Number of annotated_line with actual asm instruction in the * source list. @@ -265,6 +266,7 @@ struct annotated_source { struct sym_hist *histograms; struct hashmap *samples; int nr_histograms; + int nr_events; int nr_entries; int nr_asm_entries; int max_jump_sources; @@ -311,7 +313,6 @@ struct annotated_branch { struct LOCKABLE annotation { u64 start; - int nr_events; struct annotated_source *src; struct annotated_branch *branch; }; @@ -335,7 +336,7 @@ static inline int annotation__cycles_width(struct annotation *notes) static inline int annotation__pcnt_width(struct annotation *notes) { - return (symbol_conf.show_total_period ? 12 : 7) * notes->nr_events; + return (symbol_conf.show_total_period ? 12 : 7) * notes->src->nr_events; } static inline bool annotation_line__filter(struct annotation_line *al) |