Skip to content

Commit

Permalink
perf report: Set proper sort__mode for the branch option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
naota@elisp.net authored and Arnaldo Carvalho de Melo committed Aug 13, 2014
1 parent 82162b5 commit edd114e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
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;
}
Expand Down

0 comments on commit edd114e

Please sign in to comment.