Skip to contentSkip to conversation

perf, tools: In branch stack mode use address history sorting

PATCH New Andi Kleen 2 participants 3 messages Nov 18, 2014 – Dec 8, 2014 perf events

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/2 perf, tools: In branch stack mode use address history sorting

From: Andi Kleen <[email protected]>

Enable CCKEY_ADDRESS address history sorting with --branch-history. This makes get_srcline display the source lines correctly, otherwise all history entries for a function a hunked into one.

---
 tools/perf/builtin-report.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/builtin-report.c +1 -0
index fb272ff..3936760 100644
@@ -761,6 +761,7 @@ repeat:
 		symbol_conf.cumulate_callchain = false;
 	}
 	if (branch_call_mode) {
+		callchain_param.key = CCKEY_ADDRESS;
 		callchain_param.branch_callstack = 1;
 		symbol_conf.use_callchain = true;
 		callchain_register_param(&callchain_param);
Signature · 1 line
1.9.3
author
#1 lore raw

PATCH 2/2 perf, tools: Remove use of BUILD_BUG_ON

From: Andi Kleen <[email protected]>

BUILD_BUG_ON relies on the gcc optimizer, so it breaks the build with DEBUG=1 which doesn't use -O2.

Turn the BUILD_BUG_ON into a runtime check again.

Also fix the check to check for 255, not 127.

---
 tools/perf/util/machine.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/util/machine.c +1 -2
index 5c4d7f8..a24909b 100644
@@ -1446,8 +1446,7 @@ static int remove_loops(struct branch_entry *l, int nr)
 
 	memset(chash, NO_ENTRY, sizeof(chash));
 
-	BUILD_BUG_ON_MSG(PERF_MAX_BRANCH_DEPTH > 127,
-			 "Please upgrade the type of the hash table from unsigned char");
+	BUG_ON(PERF_MAX_BRANCH_DEPTH > 255);
 	for (i = 0; i < nr; i++) {
 		int h = hash_64(l[i].from, CHASHBITS) % CHASHSZ;
 
Signature · 1 line
1.9.3
#2 lore raw

[tip:perf/core] perf report: In branch stack mode use address history sorting

In reply to Andi Kleen
perf report: In branch stack mode use address history sorting
Commit-ID:  09a6a1b07e5a579ef770d9728f5b158408c73c23
Gitweb:     http://git.kernel.org/tip/09a6a1b07e5a579ef770d9728f5b158408c73c23
Author:     Andi Kleen <[email protected]>
AuthorDate: Mon, 17 Nov 2014 17:58:54 -0800
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 1 Dec 2014 20:00:31 -0300

perf report: In branch stack mode use address history sorting

Enable CCKEY_ADDRESS address history sorting with --branch-history. This makes get_srcline display the source lines correctly, otherwise all history entries for a function a hunked into one.

---
 tools/perf/builtin-report.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/builtin-report.c +1 -0
index fb272ff..3936760 100644
@@ -761,6 +761,7 @@ repeat:
 		symbol_conf.cumulate_callchain = false;
 	}
 	if (branch_call_mode) {
+		callchain_param.key = CCKEY_ADDRESS;
 		callchain_param.branch_callstack = 1;
 		symbol_conf.use_callchain = true;
 		callchain_register_param(&callchain_param);