aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-03-21 15:00:50 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-03-21 15:00:50 -0400
commited7b339fb570749042332169e62541b208fc4296 (patch)
tree30d7d5f408fe6ad44691d8095f1cfffb6c5b5b25 /tools/perf/util/annotate.c
parente7cb9de211ebb2924d87fdeb77e50d74c2e673d1 (diff)
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 <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Taeung Song <treeze.taeung@gmail.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-7hpx8f8ybdpiujceysaj229w@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 4d325cdcb732..22cd1dbe724b 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1482,6 +1482,12 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na
1482 1482
1483 nline = 0; 1483 nline = 0;
1484 while (!feof(file)) { 1484 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 */
1485 if (symbol__parse_objdump_line(sym, map, arch, file, privsize, 1491 if (symbol__parse_objdump_line(sym, map, arch, file, privsize,
1486 &lineno) < 0) 1492 &lineno) < 0)
1487 break; 1493 break;