perf tools: Allow to force redirect pr_debug to stderr.
authorAndi Kleen <ak@linux.intel.com>
Fri, 21 Nov 2014 21:38:00 +0000 (13:38 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 24 Nov 2014 21:03:48 +0000 (18:03 -0300)
commitf78eaef0e0493f6068777a246b9c4d9d5cf2b7aa
tree7be2606e09fe5c562f8fcfa9b742388ca4eb3ec4
parent330dfa224fcc8594977785a6493ca06d124f0cfe
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: Andi 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/debug.c