From 62e3436b5f3461662929eae102beefbd12127cb1 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 26 May 2010 13:22:26 -0300 Subject: perf tui: Reset use_browser if stdout is not a tty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The newt initialization routines weren't being called because the output was a file (perf annotate > /tmp/bla) but use_browser was still 1, because ~/.perfconfig had it as 'on', so, later on newt routines segfaulted. Cc: Frédéric Weisbecker Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Tom Zanussi LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-annotate.c | 2 +- tools/perf/util/newt.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/perf') diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 08278eda31a..96db5248e99 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -343,7 +343,7 @@ find_next: continue; } - if (use_browser) { + if (use_browser > 0) { key = hist_entry__tui_annotate(he); if (is_exit_key(key)) break; diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index d54c540f49d..cf182ca132f 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c @@ -1139,6 +1139,7 @@ void setup_browser(void) struct newtPercentTreeColors *c = &defaultPercentTreeColors; if (!isatty(1) || !use_browser || dump_trace) { + use_browser = 0; setup_pager(); return; } -- cgit v1.2.3-70-g09d2