• Masami Hiramatsu's avatar
    perf probe: Fix to list probe event with correct line number · 3895534d
    Masami Hiramatsu authored
    Since debuginfo__find_probe_point() uses dwarf_entrypc() for finding the
    entry address of the function on which a probe is, it will fail when the
    function DIE has only ranges attribute.
    
    To fix this issue, use die_entrypc() instead of dwarf_entrypc().
    
    Without this fix, perf probe -l shows incorrect offset:
    
      # perf probe -l
        probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask+18446744071579263632@work/linux/linux/kernel/cpu.c)
        probe:clear_tasks_mm_cpumask_1 (on clear_tasks_mm_cpumask+18446744071579263752@work/linux/linux/kernel/cpu.c)
    
    With this:
    
      # perf probe -l
        probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask@work/linux/linux/kernel/cpu.c)
        probe:clear_tasks_mm_cpumask_1 (on clear_tasks_mm_cpumask:21@work/linux/linux/kernel/cpu.c)
    
    Committer testing:
    
    Before:
    
      [root@quaco ~]# perf probe -l
        probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask+18446744071579765152@kernel/cpu.c)
      [root@quaco ~]#
    
    After:
    
      [root@quaco ~]# perf probe -l
        probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask@kernel/cpu.c)
      [root@quaco ~]#
    
    Fixes: 1d46ea2a ("perf probe: Fix listing incorrect line number with inline function")
    Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: http://lore.kernel.org/lkml/157199321227.8075.14655572419136993015.stgit@devnote2Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    3895534d
probe-finder.c 46.1 KB