Skip to contentSkip to conversation

perf report: Set proper sort__mode for the branch option

PATCH Applied [email protected] 4 participants 4 messages Aug 6, 2014 – Aug 14, 2014 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf report: Set proper sort__mode for the branch option

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.

---
 tools/perf/builtin-report.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-report.c +1 -1
index 21d830b..94dcf2d 100644
@@ -719,7 +719,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;
 	}
Signature · 1 line
2.0.2
maintainer Acked-by on v1 1/1
#1 lore raw

Hi Naohiro,

(CC'ing Stephane)

Quoted 7 lines

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.

Thanks for fixing this!
Namhyung

Quoted 17 lines
---
 tools/perf/builtin-report.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-report.c +1 -1
index 21d830b..94dcf2d 100644
@@ -719,7 +719,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;
 	}
maintainer Applied
#2 lore raw

Em Wed, Aug 13, 2014 at 02:45:34PM +0900, Namhyung Kim escreveu:

Quoted 10 lines

Hi Naohiro,

(CC'ing Stephane)

Quoted 6 lines

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.

Quoted 6 lines
Quoted 1 line

Thanks for fixing this!
Namhyung

Thanks, applied.

- Arnaldo

#3 lore raw
In reply to [email protected]
perf report: Set proper sort__mode for the branch option
Commit-ID:  edd114e213751c3274891f692be66eb65771f278
Gitweb:     http://git.kernel.org/tip/edd114e213751c3274891f692be66eb65771f278
Author:     [email protected] <[email protected]>
AuthorDate: Thu, 7 Aug 2014 00:04:49 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 13 Aug 2014 17:13:48 -0300

perf report: Set proper sort__mode for the branch option

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.

---
 tools/perf/builtin-report.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-report.c +1 -1
index b9e0fca..3da59a8 100644
@@ -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;
 	}