Skip to content

Commit

Permalink
perf tui: Reset use_browser if stdout is not a tty
Browse files Browse the repository at this point in the history
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 <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed May 26, 2010
1 parent 49c1774 commit 62e3436
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/builtin-annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static void hists__find_annotations(struct hists *self)
continue;
}

if (use_browser) {
if (use_browser > 0) {
key = hist_entry__tui_annotate(he);
if (is_exit_key(key))
break;
Expand Down
1 change: 1 addition & 0 deletions tools/perf/util/newt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 62e3436

Please sign in to comment.