perf, tools: Support source line numbers in annotate

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 off 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 the wrong line numbers (it always reports
the first line number in the next function even for lines
that are outside the function)
I haven't find 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.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
3 files changed