Commit f78eaef0 authored by Andi Kleen's avatar Andi Kleen Committed by Arnaldo Carvalho de Melo

perf tools: Allow to force redirect pr_debug to stderr.

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.

Example:

  [root@zoo ~]# perf --debug stderr report -vv 2> /tmp/debug
  [root@zoo ~]# tail /tmp/debug
  dso open failed, mmap: No such file or directory
  dso open failed, mmap: No such file or directory
  dso open failed, mmap: No such file or directory
  dso open failed, mmap: No such file or directory
  dso open failed, mmap: No such file or directory
  Using /root/.debug/.build-id/4e/841948927029fb650132253642d5dbb2c1fb93 for symbols
  Failed to open /tmp/perf-8831.map, continuing without symbols
  Failed to open /tmp/perf-12721.map, continuing without symbols
  Failed to open /tmp/perf-6966.map, continuing without symbols
  Failed to open /tmp/perf-8802.map, continuing without symbols
  [root@zoo ~]#
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1416605880-25055-2-git-send-email-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 330dfa22
......@@ -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, }
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment