LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 12/26] perf tools: Allow use of an exclusive option more than once
Date: Mon, 26 Jan 2015 14:47:15 -0300	[thread overview]
Message-ID: <1422294449-12735-13-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1422294449-12735-1-git-send-email-acme@kernel.org>

From: Namhyung Kim <namhyung@kernel.org>

The exclusive options are to prohibit use of conflicting options at the
same time.  But it had a side effect that it also limits a such option
can be used at most once.  Currently the only user of the flag is perf
probe and it allows to use such options more than once, but when one
tries to use it, perf will fail like below:

  $ sudo perf probe -x /lib/libc-2.20.so --add malloc --add free
    Error: option `add' cannot be used with add
  ...

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1420886028-15135-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/parse-options.c b/tools/perf/util/parse-options.c
index f62dee7bd924..4a015f77e2b5 100644
--- a/tools/perf/util/parse-options.c
+++ b/tools/perf/util/parse-options.c
@@ -46,7 +46,7 @@ static int get_value(struct parse_opt_ctx_t *p,
 		return opterror(opt, "is not usable", flags);
 
 	if (opt->flags & PARSE_OPT_EXCLUSIVE) {
-		if (p->excl_opt) {
+		if (p->excl_opt && p->excl_opt != opt) {
 			char msg[128];
 
 			if (((flags & OPT_SHORT) && p->excl_opt->short_name) ||
-- 
1.9.3


  parent reply	other threads:[~2015-01-26 17:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 17:47 [GIT PULL 00/26] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 01/26] perf mem: Enable sampling loads and stores simultaneously Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 02/26] perf mem: Move the mem_operations global to struct perf_mem Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 03/26] perf tools: Remove EOL whitespaces Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 04/26] perf hists: Rename hist_entry__free to __delete Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 05/26] perf hists: Introduce function for deleting/removing hist_entry Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 06/26] perf report: Get rid of report__inc_stat() Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 07/26] perf tools: Remove some unused functions from color.c Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 08/26] perf tools: Support parsing parameterized events Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 09/26] perf tools: Extend format_alias() to include event parameters Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 10/26] perf Documentation: Add " Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 11/26] perf tools: Document parameterized and symbolic events Arnaldo Carvalho de Melo
2015-01-26 17:47 ` Arnaldo Carvalho de Melo [this message]
2015-01-26 17:47 ` [PATCH 13/26] perf diff: Get rid of hists__compute_resort() Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 14/26] perf diff: Print diff result more precisely Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 15/26] perf diff: Introduce fmt_to_data_file() helper Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 16/26] perf tools: Pass struct perf_hpp_fmt to its callbacks Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 17/26] perf diff: Fix output ordering to honor next column Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 18/26] perf diff: Fix -o/--order option behavior Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 19/26] tools lib fs: Adopt debugfs open strerrno method Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 20/26] tools lib fs: Pass filename to debugfs__strerror_open Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 21/26] perf trace: Fix error reporting for evsel pgfault constructor Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 22/26] tools lib fs debugfs: Introduce debugfs__strerror_open_tp Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 23/26] tools lib fs debugfs: Check if debugfs is mounted when handling ENOENT Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 24/26] perf tests: Fix typo in sample-parsing.c Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 25/26] perf ui/tui: Show fatal error message only if exists Arnaldo Carvalho de Melo
2015-01-26 17:47 ` [PATCH 26/26] tools lib traceevent: Add support for IP address formats Arnaldo Carvalho de Melo
2015-01-28 14:50 ` [GIT PULL 00/26] perf/core improvements and fixes Ingo Molnar
2015-01-28 14:55   ` Arnaldo Carvalho de Melo

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=1422294449-12735-13-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --subject='Re: [PATCH 12/26] perf tools: Allow use of an exclusive option more than once' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).