Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1596240
| Path | csiph.com!feeder.erje.net!2.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Taeung Song <treeze.taeung@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 5/7] perf annotate: Get correct line numbers matched with addr |
| Date | Thu, 09 Mar 2017 18:40:02 +0100 |
| Message-ID | <tjacG-8oc-23@gated-at.bofh.it> (permalink) |
| References | <tjacG-8oc-7@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wFfU46VdJi+9Wgtdz05kHEuFV0tFUeoCyB9lN1MbQu4=; b=V2Lh8mR0p5Et5J/RjJiX21r2PQpVHvqVvhDuyX2vbarXSf0lm7/pOy4VLfQ0DSoeNJ d2BEtk3+h69z1a1bBr7ZWyh0Tzl2tgnJGVbGCtXSYxL+9bpO+5mD/7GqfDEzXgC8nu/H MuoWChB6csm1Zzw8hauYB1GmHsemJEgJKtNF49nT9/FiB0XA1olIFWjL0HfeLLqykFNN tdqFeRZvJVg98isM/ko79P/KJ+h0ijQ6YLpwug6ignKAGAgNhXXgZMEKQZ4aQneZyBmc d94Cb5H+AIf41rtMdq6SMCFOedWlDOqRj/mlEfrIkhC7Axqn60zgNBNbpMnBrOHPXtRv 8q/w== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wFfU46VdJi+9Wgtdz05kHEuFV0tFUeoCyB9lN1MbQu4=; b=gFha6eUKyUDtBjGN6V4Zvl2rZViudYukjJRdqx7BQwdpA9m0oFIux7xdfpA1k1CSzB ecBmsR697QZW+wPaE1AUyDwU70DUjX1b27g5Y5hHv2YjJc7wmAbU7ZqLxVqTLiCi5rIm c/GZ3iZ6csAPfq3alKHVuuQ4TA7xZqwOUI7SeqBeI7wrc6yY3AdWoZgi0QP2aZtW+5G1 o3Yp3zuxuCGDrqKDwXYHrilu6+ROKFWmuvQxrsbetXIInLGvSGIaBBiJGVpMbgH8w03k +kHk9i7/zhwaRszb9s2jhINJtHzK9PscFvOSNUc1CZM/vkHSiZTjVSog0HTzLNC0+idn 0K4g== |
| X-Gm-Message-State | AMke39l9tE/nNwR1NoN1XskQudC7LtBgfUwbYiQsWp6wqm0nNMjGvdKHELZOQDyua42Hbg== |
| X-Received | by 10.84.248.79 with SMTP id e15mr18937927pln.133.1489080964017; Thu, 09 Mar 2017 09:36:04 -0800 (PST) |
| X-Mailer | git-send-email 2.7.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 64 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Wang Nan <wangnan0@huawei.com>, Masami Hiramatsu <mhiramat@kernel.org>, Taeung Song <treeze.taeung@gmail.com>, Jiri Olsa <jolsa@redhat.com> |
| X-Original-Date | Fri, 10 Mar 2017 02:35:39 +0900 |
| X-Original-Message-ID | <1489080941-3965-6-git-send-email-treeze.taeung@gmail.com> |
| X-Original-References | <1489080941-3965-1-git-send-email-treeze.taeung@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1596240 |
Show key headers only | View raw
Currently perf-annotate show wrong line numbers.
For example,
Actual source code is as below
...
21 };
22
23 unsigned int limited_wgt;
24
25 unsigned int get_cond_maxprice(int wgt)
26 {
...
However, the output of perf-annotate is as below.
4 Disassembly of section .text:
6 0000000000400966 <get_cond_maxprice>:
7 get_cond_maxprice():
26 };
28 unsigned int limited_wgt;
30 unsigned int get_cond_maxprice(int wgt)
31 {
So remove the wrong way counting line numbers
and match correct line numbers to each addr of asm lines
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
---
tools/perf/util/annotate.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index e49eb7e..a50d949 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -823,11 +823,11 @@ static struct disasm_line *disasm_line__new(s64 offset, char *line,
if (dl != NULL) {
dl->offset = offset;
dl->line = strdup(line);
- dl->line_nr = line_nr;
if (dl->line == NULL)
goto out_delete;
if (offset != -1) {
+ dl->line_nr = line_nr;
if (disasm_line__parse(dl->line, &dl->ins.name, &dl->ops.raw) < 0)
goto out_free_line;
@@ -1207,7 +1207,6 @@ static int symbol__parse_objdump_line(struct symbol *sym, struct map *map,
dl = disasm_line__new(offset, parsed_line, privsize, *line_nr, arch, map);
free(line);
- (*line_nr)++;
if (dl == NULL)
return -1;
--
2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH v3 5/7] perf annotate: Get correct line numbers matched with addr Taeung Song <treeze.taeung@gmail.com> - 2017-03-09 18:40 +0100
csiph-web