mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-27 12:32:50 +00:00
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>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
bfd98ceb62
commit
6f157d9af1
@@ -186,7 +186,7 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
|
||||
* name right after the '<' token and probably treating this like a
|
||||
* 'call' instruction.
|
||||
*/
|
||||
target = notes->src->offsets[cursor->ops.target.offset];
|
||||
target = annotated_source__get_line(notes->src, cursor->ops.target.offset);
|
||||
if (target == NULL) {
|
||||
ui_helpline__printf("WARN: jump target inconsistency, press 'o', notes->offsets[%#x] = NULL\n",
|
||||
cursor->ops.target.offset);
|
||||
|
||||
Reference in New Issue
Block a user