• Namhyung Kim's avatar
    perf annotate: Add annotate_get_basic_blocks() · 5cdd3fd7
    Namhyung Kim authored
    The annotate_get_basic_blocks() is to find a list of basic blocks from
    the source instruction to the destination instruction in a function.
    
    It'll be used to find variables in a scope.  Use BFS (Breadth First
    Search) to find a shortest path to carry the variable/register state
    minimally.
    
    Also change find_disasm_line() to be used in annotate_get_basic_blocks()
    and add 'allow_update' argument to control if it can update the IP.
    Signed-off-by: default avatarNamhyung 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: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Link: https://lore.kernel.org/r/20240319055115.4063940-8-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    5cdd3fd7
annotate.h 16.1 KB