• Andi Kleen's avatar
    perf annotate: Support source line numbers in annotate · e592488c
    Andi Kleen authored
    With srcline key/sort'ing it's useful to have line numbers in the
    annotate window. This patch implements this.
    
    Use objdump -l to request the line numbers and save them in the line
    structure. Then the browser displays them for source lines.
    
    The line numbers are not displayed by default, but can be toggled on
    with 'k'
    
    There is one unfortunate problem with this setup. For lines not
    containing source and which are outside functions objdump -l reports
    line numbers off by a few: it always reports the first line number in
    the next function even for lines that are outside the function.
    
    I haven't found a nice way to detect/correct this. Probably objdump has
    to be fixed.
    
    See https://sourceware.org/bugzilla/show_bug.cgi?id=16433
    
    The line numbers are still useful even with these problems, as most are
    correct and the ones which are not are nearby.
    
    v2: Fix help text. Handle (discriminator...) output in objdump.
    Left align the line numbers.
    Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: http://lkml.kernel.org/r/1415844328-4884-9-git-send-email-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    e592488c
annotate.c 33.6 KB