Skip to content

Commit ed7b339

Browse files
committed
perf annotate: Add comment clarifying how the source code line is parsed
The source code line number (lineno) needs to be kept in accross calls to symbol__parse_objdump_line() when parsing the output of 'objdump -l -dS', so that it can associate it with the instructions till the next line. See disasm_line__new() and struct disasm_line::line_nr. Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Taeung Song <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent e7cb9de commit ed7b339

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/perf/util/annotate.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,12 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na
14821482

14831483
nline = 0;
14841484
while (!feof(file)) {
1485+
/*
1486+
* The source code line number (lineno) needs to be kept in
1487+
* accross calls to symbol__parse_objdump_line(), so that it
1488+
* can associate it with the instructions till the next one.
1489+
* See disasm_line__new() and struct disasm_line::line_nr.
1490+
*/
14851491
if (symbol__parse_objdump_line(sym, map, arch, file, privsize,
14861492
&lineno) < 0)
14871493
break;

0 commit comments

Comments
 (0)