diff options
| author | Namhyung Kim <[email protected]> | 2024-04-04 17:57:10 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2024-04-08 20:43:20 +0000 |
| commit | 6f157d9af1e42aafa469deb7c16203e39a2f9545 (patch) | |
| tree | 034db9219b1dda82a3b8c5cac2d7a59ce52c966b /tools/perf/util/annotate.h | |
| parent | perf annotate: Staticize some local functions (diff) | |
| download | kernel-6f157d9af1e42aafa469deb7c16203e39a2f9545.tar.gz kernel-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 <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Peter Zijlstra <[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.h')
| -rw-r--r-- | tools/perf/util/annotate.h | 3 |
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. * |
