mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-10 11:30:08 +01:00
The commit dc41b9b8f0 ("perf ui: Change fallback policy of
setup_browser") changed default behavior of the function but missed
setting the use_browser variable to 0 accidently. So perf report ends up
doing nothing in such cases. Fix it.
Signed-off-by: Namhyung Kim <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
47 lines
648 B
C
47 lines
648 B
C
#include "../cache.h"
|
|
#include "../debug.h"
|
|
|
|
|
|
void setup_browser(bool fallback_to_pager)
|
|
{
|
|
if (!isatty(1) || dump_trace)
|
|
use_browser = 0;
|
|
|
|
/* default to TUI */
|
|
if (use_browser < 0)
|
|
use_browser = 1;
|
|
|
|
switch (use_browser) {
|
|
case 2:
|
|
if (perf_gtk__init() == 0)
|
|
break;
|
|
/* fall through */
|
|
case 1:
|
|
use_browser = 1;
|
|
if (ui__init() == 0)
|
|
break;
|
|
/* fall through */
|
|
default:
|
|
use_browser = 0;
|
|
if (fallback_to_pager)
|
|
setup_pager();
|
|
break;
|
|
}
|
|
}
|
|
|
|
void exit_browser(bool wait_for_ok)
|
|
{
|
|
switch (use_browser) {
|
|
case 2:
|
|
perf_gtk__exit(wait_for_ok);
|
|
break;
|
|
|
|
case 1:
|
|
ui__exit(wait_for_ok);
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|