All of 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>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 04/11] perf report: Check argument before calling setup_browser()
Date: Thu, 10 Dec 2015 16:43:24 -0300	[thread overview]
Message-ID: <1449776611-18538-5-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1449776611-18538-1-git-send-email-acme@kernel.org>

From: Namhyung Kim <namhyung@kernel.org>

This is necessary to get rid of the browser dependency from
usage_with_options() and its friends.  Because there's no code
changing the argc and argv, it'd be ok to check it early.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1449716459-23004-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-report.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index af5db885ea9c..5a454669d075 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -801,6 +801,16 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
 	perf_config(report__config, &report);
 
 	argc = parse_options(argc, argv, options, report_usage, 0);
+	if (argc) {
+		/*
+		 * Special case: if there's an argument left then assume that
+		 * it's a symbol filter:
+		 */
+		if (argc > 1)
+			usage_with_options(report_usage, options);
+
+		report.symbol_filter_str = argv[0];
+	}
 
 	if (symbol_conf.vmlinux_name &&
 	    access(symbol_conf.vmlinux_name, R_OK)) {
@@ -946,17 +956,6 @@ repeat:
 	if (symbol__init(&session->header.env) < 0)
 		goto error;
 
-	if (argc) {
-		/*
-		 * Special case: if there's an argument left then assume that
-		 * it's a symbol filter:
-		 */
-		if (argc > 1)
-			usage_with_options(report_usage, options);
-
-		report.symbol_filter_str = argv[0];
-	}
-
 	sort__setup_elide(stdout);
 
 	ret = __cmd_report(&report);
-- 
2.1.0


  parent reply	other threads:[~2015-12-10 19:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 19:43 [GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 01/11] perf annotate: Check argument before calling setup_browser() Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 02/11] perf annotate: Delay UI browser setup after initialization is done Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 03/11] perf kvm: Remove invocation of setup/exit_browser() Arnaldo Carvalho de Melo
2015-12-10 19:43 ` Arnaldo Carvalho de Melo [this message]
2015-12-10 19:43 ` [PATCH 05/11] perf top: Do show usage message when failing to create cpu/thread maps Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 06/11] perf thread_map: Free strlist on constructor error path Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 07/11] perf tools: Get rid of exit_browser() from usage_with_options() Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 08/11] perf top: Delete half-processed hist entries when exit Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 09/11] Revert "perf tools: Improve setting of gcc debug option" Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 10/11] perf tools: Make perf_session__register_idle_thread drop the refcount Arnaldo Carvalho de Melo
2015-12-10 19:43 ` [PATCH 11/11] perf symbols: Fix dso__load_sym to put dso Arnaldo Carvalho de Melo
2015-12-11  7:48 ` [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar

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=1449776611-18538-5-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=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /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.