perf tools: Don't fallback to setup_pager unconditionally
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 31 Jan 2011 20:08:39 +0000 (18:08 -0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 31 Jan 2011 20:08:39 +0000 (18:08 -0200)
Because in tools like 'top' we don't want the pager.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
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>
tools/perf/builtin-annotate.c
tools/perf/builtin-report.c
tools/perf/util/cache.h
tools/perf/util/ui/setup.c

index 70067862e07fd5ef07e53f03c9cbdd290acc7d2a..cd9dec46c19fdf769f4666db47de620e9c301d59 100644 (file)
@@ -452,7 +452,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used)
        else if (use_tui)
                use_browser = 1;
 
-       setup_browser();
+       setup_browser(true);
 
        symbol_conf.priv_size = sizeof(struct sym_priv);
        symbol_conf.try_vmlinux_path = true;
index a6a4e5457b6fe9a2e76dd60ca460732fc64ca924..080937c3a656b86038a32767eb7e03993836b248 100644 (file)
@@ -499,7 +499,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
                use_browser = 1;
 
        if (strcmp(input_name, "-") != 0)
-               setup_browser();
+               setup_browser(true);
        else
                use_browser = 0;
        /*
index a7729797fd96254bc35326077337a71f919c19b5..fc5e5a09d5b94102b7adaed11518dd8be2c0eb84 100644 (file)
@@ -34,13 +34,14 @@ extern int pager_use_color;
 extern int use_browser;
 
 #ifdef NO_NEWT_SUPPORT
-static inline void setup_browser(void)
+static inline void setup_browser(bool fallback_to_pager)
 {
-       setup_pager();
+       if (fallback_to_pager)
+               setup_pager();
 }
 static inline void exit_browser(bool wait_for_ok __used) {}
 #else
-void setup_browser(void);
+void setup_browser(bool fallback_to_pager);
 void exit_browser(bool wait_for_ok);
 #endif
 
index 662085032eb7f4d577953961b7537a6e522dd118..fbf1a145492f865fee15945e10717b1121d5566c 100644 (file)
@@ -14,11 +14,12 @@ static void newt_suspend(void *d __used)
        newtResume();
 }
 
-void setup_browser(void)
+void setup_browser(bool fallback_to_pager)
 {
        if (!isatty(1) || !use_browser || dump_trace) {
                use_browser = 0;
-               setup_pager();
+               if (fallback_to_pager)
+                       setup_pager();
                return;
        }