public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	LKML <linux-kernel@vger.kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	David Ahern <dsahern@gmail.com>
Subject: [PATCH 1/6] perf report: Use pr_*() functions if possible
Date: Thu, 19 Dec 2013 16:00:06 +0900	[thread overview]
Message-ID: <1387436411-20160-2-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1387436411-20160-1-git-send-email-namhyung@kernel.org>

From: Namhyung Kim <namhyung.kim@lge.com>

There're some places printing a message to stdout/err directly.  It
should be converted to use proper error printing functions instead.

If it's not possible, just do it when --stdio was enabled only.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/builtin-report.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 3a14dbed387c..a1f72b471a96 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -321,8 +321,8 @@ static int process_sample_event(struct perf_tool *tool,
 	int ret;
 
 	if (perf_event__preprocess_sample(event, machine, &al, sample) < 0) {
-		fprintf(stderr, "problem processing %d event, skipping it.\n",
-			event->header.type);
+		pr_debug("problem processing %d event, skipping it.\n",
+			 event->header.type);
 		return -1;
 	}
 
@@ -552,15 +552,17 @@ static int __cmd_report(struct perf_report *rep)
 		desc);
 	}
 
-	if (verbose > 3)
-		perf_session__fprintf(session, stdout);
+	if (use_browser == 0) {
+		if (verbose > 3)
+			perf_session__fprintf(session, stdout);
 
-	if (verbose > 2)
-		perf_session__fprintf_dsos(session, stdout);
+		if (verbose > 2)
+			perf_session__fprintf_dsos(session, stdout);
 
-	if (dump_trace) {
-		perf_session__fprintf_nr_events(session, stdout);
-		return 0;
+		if (dump_trace) {
+			perf_session__fprintf_nr_events(session, stdout);
+			return 0;
+		}
 	}
 
 	nr_samples = 0;
@@ -720,7 +722,7 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
 		return -1;
 setup:
 	if (callchain_register_param(&callchain_param) < 0) {
-		fprintf(stderr, "Can't register callchain params\n");
+		pr_err("Can't register callchain params\n");
 		return -1;
 	}
 	return 0;
@@ -942,7 +944,7 @@ repeat:
 	}
 	if (report.mem_mode) {
 		if (sort__mode == SORT_MODE__BRANCH) {
-			fprintf(stderr, "branch and mem mode incompatible\n");
+			pr_err("branch and mem mode incompatible\n");
 			goto error;
 		}
 		sort__mode = SORT_MODE__MEMORY;
-- 
1.7.11.7


  reply	other threads:[~2013-12-19  7:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19  7:00 [PATCHSET 0/6] perf tools: A couple of TUI improvements Namhyung Kim
2013-12-19  7:00 ` Namhyung Kim [this message]
2013-12-19 13:30   ` [PATCH 1/6] perf report: Use pr_*() functions if possible Arnaldo Carvalho de Melo
2013-12-20  1:32     ` Namhyung Kim
2013-12-19 13:31   ` Jiri Olsa
2013-12-20  1:36     ` Namhyung Kim
2013-12-19  7:00 ` [PATCH 2/6] perf tools: Introduce struct perf_log Namhyung Kim
2013-12-19 13:28   ` Arnaldo Carvalho de Melo
2013-12-20  1:28     ` Namhyung Kim
2013-12-19  7:00 ` [PATCH 3/6] perf tools: Get rid of a duplicate va_end() Namhyung Kim
2013-12-19 13:32   ` Jiri Olsa
2013-12-19 13:32   ` Arnaldo Carvalho de Melo
2014-01-12 18:32   ` [tip:perf/core] perf tools: Get rid of a duplicate va_end() in error reporting routine tip-bot for Namhyung Kim
2013-12-19  7:00 ` [PATCH 4/6] perf tools: Save message when pr_*() was called Namhyung Kim
2013-12-19  7:00 ` [PATCH 5/6] perf ui/tui: Implement log window Namhyung Kim
2013-12-19  7:00 ` [PATCH 6/6] perf ui/tui: Implement header window Namhyung Kim
2013-12-19 12:14 ` [PATCHSET 0/6] perf tools: A couple of TUI improvements Ingo Molnar
2013-12-20  1:20   ` Namhyung Kim
2013-12-19 13:39 ` Jiri Olsa
2013-12-19 15:51   ` Ingo Molnar
2013-12-19 15:53   ` Ingo Molnar
2013-12-20  1:21     ` Namhyung Kim

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=1387436411-20160-2-git-send-email-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox