From: "tip-bot2 for Ravi Bangoria" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Jiri Olsa <jolsa@redhat.com>, Ian Rogers <irogers@google.com>,
Jin Yao <yao.jin@linux.intel.com>,
Namhyung Kim <namhyung@kernel.org>,
Song Liu <songliubraving@fb.com>, x86 <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [tip: perf/urgent] perf annotate: Fix segfault with source toggle
Date: Sat, 29 Feb 2020 09:16:46 -0000 [thread overview]
Message-ID: <158296780605.28353.6653240778636614172.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200204045233.474937-5-ravi.bangoria@linux.ibm.com>
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: e0560ba6d92f06dbe13e9d11c921a60c07ea6fcc
Gitweb: https://git.kernel.org/tip/e0560ba6d92f06dbe13e9d11c921a60c07ea6fcc
Author: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
AuthorDate: Tue, 04 Feb 2020 10:22:31 +05:30
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Thu, 27 Feb 2020 11:47:23 -03:00
perf annotate: Fix segfault with source toggle
While rendering annotate browser from perf report tui, we keep track
of total number of lines(asm + source) in annotation->nr_entries and
total number of asm lines in annotation->nr_asm_entries. But we don't
reset them before starting. Thus if user annotates same function
multiple times, we restart incrementing these fields with old values.
This causes a segfault when user tries to toggle source code after
annotating same function multiple times. Fix it.
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Link: http://lore.kernel.org/lkml/20200204045233.474937-5-ravi.bangoria@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/annotate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index c816e58..0ea95be 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -2621,6 +2621,8 @@ void annotation__set_offsets(struct annotation *notes, s64 size)
struct annotation_line *al;
notes->max_line_len = 0;
+ notes->nr_entries = 0;
+ notes->nr_asm_entries = 0;
list_for_each_entry(al, ¬es->src->source, node) {
size_t line_len = strlen(al->line);
next prev parent reply other threads:[~2020-02-29 9:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-04 4:52 [PATCH v3 0/6] perf annotate: Misc fixes / improvements Ravi Bangoria
2020-02-04 4:52 ` [PATCH v3 1/6] perf annotate: Remove privsize from symbol__annotate() args Ravi Bangoria
2020-02-29 9:16 ` [tip: perf/urgent] " tip-bot2 for Ravi Bangoria
2020-02-04 4:52 ` [PATCH v3 2/6] perf annotate: Simplify disasm_line allocation and freeing code Ravi Bangoria
2020-02-29 9:16 ` [tip: perf/urgent] " tip-bot2 for Ravi Bangoria
2020-02-04 4:52 ` [PATCH v3 3/6] perf annotate: Align struct annotate_args Ravi Bangoria
2020-02-29 9:16 ` [tip: perf/urgent] " tip-bot2 for Ravi Bangoria
2020-02-04 4:52 ` [PATCH v3 4/6] perf annotate: Fix segfault with source toggle Ravi Bangoria
2020-02-29 9:16 ` tip-bot2 for Ravi Bangoria [this message]
2020-02-04 4:52 ` [PATCH v3 5/6] perf annotate: Make few functions static Ravi Bangoria
2020-02-04 4:52 ` [PATCH v3 6/6] perf annotate: Get rid of annotation->nr_jumps Ravi Bangoria
2020-03-19 14:10 ` [tip: perf/core] " tip-bot2 for Ravi Bangoria
2020-02-06 19:04 ` [PATCH v3 0/6] perf annotate: Misc fixes / improvements Jiri Olsa
2020-02-27 14:11 ` Arnaldo Carvalho de Melo
2020-02-28 14:42 ` Ravi Bangoria
2020-02-28 14:59 ` Arnaldo Melo
2020-02-28 15:01 ` Arnaldo Melo
2020-02-10 12:18 ` Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=158296780605.28353.6653240778636614172.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=acme@redhat.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=ravi.bangoria@linux.ibm.com \
--cc=songliubraving@fb.com \
--cc=x86@kernel.org \
--cc=yao.jin@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®