• Masami Hiramatsu's avatar
    perf probe: Fix listing incorrect line number with inline function · 1d46ea2a
    Masami Hiramatsu authored
    Fix a bug showing incorrect line number when a probe is put on the head of an
    inline function. This patch updates find_perf_probe_point() and introduces new
    rules to get correct line number.
    
     - If debuginfo doesn't have a correct file name, we shouldn't return line
       number too, because, without file name, line number is meaningless.
    
     - If the address is in a function, it stores the function name and the offset
       from the function entry.
    
       - If the address is on a line, it tries to get the relative line number from
         the function entry line, except for the address is same as the entry
         address of the function (in this case, the relative line number should
         be 0).
    
         - If the address is in an inline function entry (call-site), it uses the
           inline function call line number as the line on which the address is.
    
       - If the address is in an inline function body, it stores the inline
         function name and offset from the inline function call site instead of the
         (non-inlined) function.
    
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Lin Ming <ming.m.lin@intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    LKML-Reference: <20110330092605.2132.11629.stgit@ltc236.sdl.hitachi.co.jp>
    Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    1d46ea2a
probe-finder.c 48.5 KB