From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753371Ab1HNPom (ORCPT ); Sun, 14 Aug 2011 11:44:42 -0400 Received: from hera.kernel.org ([140.211.167.34]:45338 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751688Ab1HNPok (ORCPT ); Sun, 14 Aug 2011 11:44:40 -0400 Date: Sun, 14 Aug 2011 15:44:20 GMT From: tip-bot for Masami Hiramatsu Message-ID: 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 Reply-To: mingo@redhat.com, hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, acme@redhat.com, penberg@kernel.org, peterz@infradead.org, masami.hiramatsu.pt@hitachi.com, fweisbec@gmail.com, dsahern@gmail.com, tglx@linutronix.de, mingo@elte.hu In-Reply-To: <20110811110253.19900.96192.stgit@fedora15> References: <20110811110253.19900.96192.stgit@fedora15> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf probe: Warn when more than one line are given Git-Commit-ID: 13e27d7686c457c625242fc2c20be30eef942408 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Sun, 14 Aug 2011 15:44:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 13e27d7686c457c625242fc2c20be30eef942408 Gitweb: http://git.kernel.org/tip/13e27d7686c457c625242fc2c20be30eef942408 Author: Masami Hiramatsu AuthorDate: Thu, 11 Aug 2011 20:02:53 +0900 Committer: Arnaldo Carvalho de Melo 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 Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Paul Mackerras Cc: Pekka Enberg Cc: Peter Zijlstra Cc: yrl.pp-manager.tt@hitachi.com Link: http://lkml.kernel.org/r/20110811110253.19900.96192.stgit@fedora15 Signed-off-by: Masami Hiramatsu Signed-off-by: Arnaldo Carvalho de Melo --- 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, ¶ms.line_range); - INIT_LIST_HEAD(¶ms.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, ¶ms.line_range); + INIT_LIST_HEAD(¶ms.line_range.line_list); return ret; }