All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@redhat.com, peterz@infradead.org,
	penberg@kernel.org, masami.hiramatsu.pt@hitachi.com,
	fweisbec@gmail.com, dsahern@gmail.com, tglx@linutronix.de,
	mingo@elte.hu
Subject: [tip:perf/core] perf probe: Warn when more than one line are given
Date: Sun, 14 Aug 2011 15:44:20 GMT	[thread overview]
Message-ID: <tip-13e27d7686c457c625242fc2c20be30eef942408@git.kernel.org> (raw)
In-Reply-To: <20110811110253.19900.96192.stgit@fedora15>

Commit-ID:  13e27d7686c457c625242fc2c20be30eef942408
Gitweb:     http://git.kernel.org/tip/13e27d7686c457c625242fc2c20be30eef942408
Author:     Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
AuthorDate: Thu, 11 Aug 2011 20:02:53 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 12 Aug 2011 09:27:11 -0300

perf probe: Warn when more than one line are given

Check multiple --lines option and print warning informing that only the
first specified --line option is valid.

Changes from the 1st post:

- Accept only the first option instead of the last.
- Fix warning message according to David's comment.
- Mark as a bugfix.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20110811110253.19900.96192.stgit@fedora15
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-probe.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 5f2a5c7..710ae3d 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -134,10 +134,18 @@ static int opt_show_lines(const struct option *opt __used,
 {
 	int ret = 0;
 
-	if (str)
-		ret = parse_line_range_desc(str, &params.line_range);
-	INIT_LIST_HEAD(&params.line_range.line_list);
+	if (!str)
+		return 0;
+
+	if (params.show_lines) {
+		pr_warning("Warning: more than one --line options are"
+			   " detected. Only the first one is valid.\n");
+		return 0;
+	}
+
 	params.show_lines = true;
+	ret = parse_line_range_desc(str, &params.line_range);
+	INIT_LIST_HEAD(&params.line_range.line_list);
 
 	return ret;
 }

  reply	other threads:[~2011-08-14 15:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 11:02 [PATCH -tip v2 0/9]perf probe bugfixes Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 1/9] [BUGFIX] perf-probe: Fix a memory leak for scopes array Masami Hiramatsu
2011-08-14 15:39   ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 2/9] [BUGFIX] perf probe: Fix line walker to check CU correctly Masami Hiramatsu
2011-08-14 15:40   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 3/9] [BUGFIX] perf probe: Fix to search nested inlined functions in CU Masami Hiramatsu
2011-08-14 15:41   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 4/9] [BUGFIX] perf probe: Fix to walk all inline instances Masami Hiramatsu
2011-08-14 15:42   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:02 ` [PATCH -tip v2 5/9] [BUGFIX] perf probe: Warn when more than one line are given Masami Hiramatsu
2011-08-14 15:44   ` tip-bot for Masami Hiramatsu [this message]
2011-08-11 11:02 ` [PATCH -tip v2 6/9] [BUGFIX] perf probe: Fix to search local variables in appropriate scope Masami Hiramatsu
2011-08-14 15:45   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:03 ` [PATCH -tip v2 7/9] [BUGFIX] perf probe: Avoid searching variables in intermediate scopes Masami Hiramatsu
2011-08-14 15:47   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:03 ` [PATCH -tip v2 8/9] [BUGFIX] perf probe: Search concrete out-of-line instances Masami Hiramatsu
2011-08-14 15:48   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2011-08-11 11:03 ` [PATCH -tip v2 9/9] [BUGFIX] perf probe: Filter out redundant inline-instances Masami Hiramatsu
2011-08-14 15:50   ` [tip:perf/core] " tip-bot for Masami Hiramatsu

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-13e27d7686c457c625242fc2c20be30eef942408@git.kernel.org \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=penberg@kernel.org \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.