serial: 8250_dw: Don't use UPF_FIXED_TYPE
[linux/fpc-iii.git] / tools / perf / ui / setup.c
blobebb4cc10787625aca596f6a41a14d56efd9e60d8
1 #include <pthread.h>
3 #include "../util/cache.h"
4 #include "../util/debug.h"
5 #include "../util/hist.h"
7 pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;
9 void setup_browser(bool fallback_to_pager)
11 if (!isatty(1) || dump_trace)
12 use_browser = 0;
14 /* default to TUI */
15 if (use_browser < 0)
16 use_browser = 1;
18 switch (use_browser) {
19 case 2:
20 if (perf_gtk__init() == 0)
21 break;
22 /* fall through */
23 case 1:
24 use_browser = 1;
25 if (ui__init() == 0)
26 break;
27 /* fall through */
28 default:
29 use_browser = 0;
30 if (fallback_to_pager)
31 setup_pager();
33 perf_hpp__init();
34 break;
38 void exit_browser(bool wait_for_ok)
40 switch (use_browser) {
41 case 2:
42 perf_gtk__exit(wait_for_ok);
43 break;
45 case 1:
46 ui__exit(wait_for_ok);
47 break;
49 default:
50 break;