perf report: Set proper sort__mode for the branch option
authornaota@elisp.net <naota@elisp.net>
Wed, 6 Aug 2014 15:04:49 +0000 (00:04 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 13 Aug 2014 20:13:48 +0000 (17:13 -0300)
When you specify "--branch-stack"("-b" for short) or
"--no-branch-stack", "branch_mode" variable is set to 1 or 0
respectively. However, the code is just checking if the variable is -1
or not, ignoring "branch_mode == 1" case. Thus "perf report -b" dose not
show its result with the branch sorted mode. This patch fix the problem.

Signed-off-by: Naohiro Aota <naota@elisp.net>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/87y4v1fylq.fsf@elisp.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-report.c

index b9e0fcac4d71ed1266107eeba3754635d4e0e4f7..3da59a87ec7c483795db56d380595d2a846536fe 100644 (file)
@@ -730,7 +730,7 @@ repeat:
        has_br_stack = perf_header__has_feat(&session->header,
                                             HEADER_BRANCH_STACK);
 
-       if (branch_mode == -1 && has_br_stack) {
+       if ((branch_mode == -1 && has_br_stack) || branch_mode == 1) {
                sort__mode = SORT_MODE__BRANCH;
                symbol_conf.cumulate_callchain = false;
        }