diff options
Diffstat (limited to 'tools/perf/builtin-top.c')
| -rw-r--r-- | tools/perf/builtin-top.c | 13 | 
1 files changed, 11 insertions, 2 deletions
| diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index ecf319728f25..8c465c83aabf 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -40,6 +40,7 @@  #include "util/xyarray.h"  #include "util/sort.h"  #include "util/intlist.h" +#include "util/parse-branch-options.h"  #include "arch/common.h"  #include "util/debug.h" @@ -601,8 +602,8 @@ static void display_sig(int sig __maybe_unused)  static void display_setup_sig(void)  { -	signal(SIGSEGV, display_sig); -	signal(SIGFPE,  display_sig); +	signal(SIGSEGV, sighandler_dump_stack); +	signal(SIGFPE, sighandler_dump_stack);  	signal(SIGINT,  display_sig);  	signal(SIGQUIT, display_sig);  	signal(SIGTERM, display_sig); @@ -695,6 +696,8 @@ static int hist_iter__top_callback(struct hist_entry_iter *iter,  		perf_top__record_precise_ip(top, he, evsel->idx, ip);  	} +	hist__account_cycles(iter->sample->branch_stack, al, iter->sample, +		     !(top->record_opts.branch_stack & PERF_SAMPLE_BRANCH_ANY));  	return 0;  } @@ -1171,6 +1174,12 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)  		   "don't try to adjust column width, use these fixed values"),  	OPT_UINTEGER(0, "proc-map-timeout", &opts->proc_map_timeout,  			"per thread proc mmap processing timeout in ms"), +	OPT_CALLBACK_NOOPT('b', "branch-any", &opts->branch_stack, +		     "branch any", "sample any taken branches", +		     parse_branch_stack), +	OPT_CALLBACK('j', "branch-filter", &opts->branch_stack, +		     "branch filter mask", "branch stack filter modes", +		     parse_branch_stack),  	OPT_END()  	};  	const char * const top_usage[] = { |