[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1416605880-25055-2-git-send-email-andi@firstfloor.org>
Date: Fri, 21 Nov 2014 13:38:00 -0800
From: Andi Kleen <andi@...stfloor.org>
To: acme@...nel.org
Cc: jolsa@...hat.com, linux-kernel@...r.kernel.org,
namhyung@...nel.org, Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 2/2] perf, tools: Allow to force redirect pr_debug to stderr.
From: Andi Kleen <ak@...ux.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@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists