From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
masami.hiramatsu.pt@hitachi.com, tglx@linutronix.de,
namhyung@kernel.org, jolsa@redhat.com
Subject: [tip:perf/urgent] perf probe: Fix --line option behavior
Date: Mon, 14 Apr 2014 07:53:00 -0700 [thread overview]
Message-ID: <tip-202c7c123c96a1c193149b7fa2718d7fb143efb2@git.kernel.org> (raw)
In-Reply-To: <1396327677-3657-1-git-send-email-namhyung@kernel.org>
Commit-ID: 202c7c123c96a1c193149b7fa2718d7fb143efb2
Gitweb: http://git.kernel.org/tip/202c7c123c96a1c193149b7fa2718d7fb143efb2
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Tue, 1 Apr 2014 13:47:57 +0900
Committer: Jiri Olsa <jolsa@redhat.com>
CommitDate: Mon, 14 Apr 2014 12:55:39 +0200
perf probe: Fix --line option behavior
The commit 5a62257a3ddd1 ("perf probe: Replace line_list with
intlist") replaced line_list to intlist but it has a problem that if a
same line was added again, it'd return -EEXIST rather than 1.
Since line_range_walk_cb() only checks the result being negative, it
resulted in failure or segfault sometimes.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Link: http://lkml.kernel.org/r/1396327677-3657-1-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
tools/perf/util/probe-finder.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index df02386..3bf0c8c 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1441,13 +1441,15 @@ static int line_range_walk_cb(const char *fname, int lineno,
void *data)
{
struct line_finder *lf = data;
+ int err;
if ((strtailcmp(fname, lf->fname) != 0) ||
(lf->lno_s > lineno || lf->lno_e < lineno))
return 0;
- if (line_range_add_line(fname, lineno, lf->lr) < 0)
- return -EINVAL;
+ err = line_range_add_line(fname, lineno, lf->lr);
+ if (err < 0 && err != -EEXIST)
+ return err;
return 0;
}
prev parent reply other threads:[~2014-04-14 14:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 4:47 [PATCH] " Namhyung Kim
2014-04-01 5:01 ` Masami Hiramatsu
2014-04-01 7:21 ` Namhyung Kim
2014-04-01 7:40 ` Masami Hiramatsu
2014-04-02 5:48 ` [PATCH -tip ] [BUGFIX] perf/probe: Fix to handle errors in line_range searching Masami Hiramatsu
2014-04-06 12:52 ` Jiri Olsa
2014-04-07 5:29 ` Namhyung Kim
2014-04-14 14:53 ` [tip:perf/urgent] perf probe: " tip-bot for Masami Hiramatsu
2014-04-14 14:53 ` tip-bot for Namhyung Kim [this message]
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=tip-202c7c123c96a1c193149b7fa2718d7fb143efb2@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome