 2b676bf068
			
		
	
	
	2b676bf068
	
	
	
		
			
			Basic implementation of perf annotate on GTK2. Currently only shows first symbol. Add a new --gtk option to use it. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1360227734-375-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
		
			
				
	
	
		
			53 lines
		
	
	
	
		
			849 B
			
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
	
		
			849 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__column_enable(PERF_HPP__OVERHEAD);
 | |
| 		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;
 | |
| 	}
 | |
| }
 |