perf annotate: Allow 's' on source code lines
authorRiccardo Mancini <rickyman7@gmail.com>
Thu, 24 Jun 2021 22:34:22 +0000 (00:34 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Jul 2021 19:14:38 +0000 (16:14 -0300)
commit6de249d66d2e7881b0cefe7f5c9c8b5385f6c15f
tree291d9399d26cf171691bf1b9cb409ea25eb3d203
parentec4c00fedbf3e713776d2776e88a7e4bc61b7efc
perf annotate: Allow 's' on source code lines

In perf annotate, when 's' is pressed on a line containing source code,
it shows the message "Only available for assembly lines".

This patch gets rid of the error, moving the cursr to the next available
asm line (or the closest previous one if no asm line is found moving
forwards), before hiding source code lines.

Changes in v2:
 - handle case of no asm line found in
   annotate_browser__find_next_asm_line by returning NULL and
   handling error in caller.

Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Martin Liška <mliska@suse.cz>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20210624223423.189550-1-rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/annotate.c