aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/annotate-data.h
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2024-03-18 22:51:14 -0700
committerArnaldo Carvalho de Melo <[email protected]>2024-03-21 10:41:29 -0300
commit55ee3d005d62279d3951a26d5c211a4d9aebc222 (patch)
treed01e4d07b797c6a650c922622e7b36f558b65700 /tools/perf/util/annotate-data.h
parentb3c95109c131fcc959d2473e7c384d8cc62d23d0 (diff)
perf annotate-data: Add a cache for global variable types
They are often searched by many different places. Let's add a cache for them to reduce the duplicate DWARF access. Signed-off-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate-data.h')
-rw-r--r--tools/perf/util/annotate-data.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/annotate-data.h b/tools/perf/util/annotate-data.h
index 1b5a152163b5..fe1e53d6e8c7 100644
--- a/tools/perf/util/annotate-data.h
+++ b/tools/perf/util/annotate-data.h
@@ -153,6 +153,9 @@ int annotated_data_type__update_samples(struct annotated_data_type *adt,
/* Release all data type information in the tree */
void annotated_data_type__tree_delete(struct rb_root *root);
+/* Release all global variable information in the tree */
+void global_var_type__tree_delete(struct rb_root *root);
+
#else /* HAVE_DWARF_SUPPORT */
static inline struct annotated_data_type *
@@ -175,6 +178,10 @@ static inline void annotated_data_type__tree_delete(struct rb_root *root __maybe
{
}
+static inline void global_var_type__tree_delete(struct rb_root *root __maybe_unused)
+{
+}
+
#endif /* HAVE_DWARF_SUPPORT */
#endif /* _PERF_ANNOTATE_DATA_H */