 2b8bfa6bb8
			
		
	
	
	2b8bfa6bb8
	
	
	
		
			
			Now when diff command is separated from other standard outputs, we can use perf_hpp__init to initialize all standard columns. Moving PERF_HPP__OVERHEAD column init back to perf_hpp__init, and removing extra enable calls. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-nj2xk89tj972tbqswfs498ex@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
		
			
				
	
	
		
			52 lines
		
	
	
	
		
			802 B
			
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
	
		
			802 B
			
		
	
	
	
		
			C
		
	
	
	
	
	
| #include <pthread.h>
 | |
| 
 | |
| #include "../util/cache.h"
 | |
| #include "../util/debug.h"
 | |
| #include "../util/hist.h"
 | |
| 
 | |
| pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;
 | |
| 
 | |
| void setup_browser(bool fallback_to_pager)
 | |
| {
 | |
| 	if (use_browser < 2 && (!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();
 | |
| 
 | |
| 		perf_hpp__init();
 | |
| 		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;
 | |
| 	}
 | |
| }
 |