summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2024-04-04 19:57:10 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-04-08 22:43:20 +0200
commit6f157d9af1e42aafa469deb7c16203e39a2f9545 (patch)
tree034db9219b1dda82a3b8c5cac2d7a59ce52c966b /tools/perf/util/annotate.h
parentperf annotate: Staticize some local functions (diff)
downloadlinux-6f157d9af1e42aafa469deb7c16203e39a2f9545.tar.xz
linux-6f157d9af1e42aafa469deb7c16203e39a2f9545.zip
perf annotate: Introduce annotated_source__get_line()
It's a helper function to get annotation_line at the given offset without using the offsets array. The goal is to get rid of the offsets array altogether. It just does the linear search but I think it's better to save memory as it won't be called in a hot path. 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-4-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 3f383f38f65f..aa3298c20300 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -270,6 +270,9 @@ struct annotated_source {
u16 max_line_len;
};
+struct annotation_line *annotated_source__get_line(struct annotated_source *src,
+ s64 offset);
+
/**
* struct annotated_branch - basic block and IPC information for a symbol.
*