mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: acme@kernel.org
Cc: jolsa@redhat.com, linux-kernel@vger.kernel.org,
	namhyung@kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 2/2] perf, tools: Allow to force redirect pr_debug to stderr.
Date: Fri, 21 Nov 2014 13:38:00 -0800	[thread overview]
Message-ID: <1416605880-25055-2-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1416605880-25055-1-git-send-email-andi@firstfloor.org>

From: Andi Kleen <ak@linux.intel.com>

When debugging the tui browser I find it useful to
redirect the debug log into a file. Currently it's always
forced to the message line.

Add an option to force it to stderr. Then it can be
easily redirected.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/util/debug.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index ba357f3..ad60b2f 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -19,13 +19,14 @@
 int verbose;
 bool dump_trace = false, quiet = false;
 int debug_ordered_events;
+static int redirect_to_stderr;
 
 static int _eprintf(int level, int var, const char *fmt, va_list args)
 {
 	int ret = 0;
 
 	if (var >= level) {
-		if (use_browser >= 1)
+		if (use_browser >= 1 && !redirect_to_stderr)
 			ui_helpline__vshow(fmt, args);
 		else
 			ret = vfprintf(stderr, fmt, args);
@@ -145,6 +146,7 @@ static struct debug_variable {
 } debug_variables[] = {
 	{ .name = "verbose",		.ptr = &verbose },
 	{ .name = "ordered-events",	.ptr = &debug_ordered_events},
+	{ .name = "stderr",		.ptr = &redirect_to_stderr},
 	{ .name = NULL, }
 };
 
-- 
1.9.3


  reply	other threads:[~2014-11-21 21:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 21:37 [PATCH 1/2] perf, tools: Fix crash while reading old perf.data Andi Kleen
2014-11-21 21:38 ` Andi Kleen [this message]
2014-12-08  6:50   ` [tip:perf/core] perf tools: Allow to force redirect pr_debug to stderr tip-bot for Andi Kleen
2014-11-25  9:53 ` [PATCH 1/2] perf, tools: Fix crash while reading old perf.data Jiri Olsa

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=1416605880-25055-2-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®