Skip to contentSkip to conversation

perf annotate browser: Count the numbers of jump sources to a target

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message May 14, 2012 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  7d5b12f5a01d338d23874c7c242a74813a8848b2
Gitweb:     http://git.kernel.org/tip/7d5b12f5a01d338d23874c7c242a74813a8848b2
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Sat, 12 May 2012 13:40:52 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sat, 12 May 2012 13:40:52 -0300

perf annotate browser: Count the numbers of jump sources to a target

Instead of simply marking an offset as a jump target. So that we can implement a new feature: showing "jumpy" targets, I.e. addresses that lots of places jump to.

Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/ui/browsers/annotate.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/ui/browsers/annotate.c +3 -3
index 06367c1..4463626 100644
@@ -16,7 +16,7 @@ struct browser_disasm_line {
 	double		percent;
 	u32		idx;
 	int		idx_asm;
-	bool		jump_target;
+	int		jump_sources;
 };
 
 struct annotate_browser {
@@ -98,7 +98,7 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro
 		if (!ab->use_offset) {
 			printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr);
 		} else {
-			if (bdl->jump_target) {
+			if (bdl->jump_sources) {
 				printed = scnprintf(bf, sizeof(bf), "%*" PRIx64 ": ",
 						    ab->addr_width, addr);
 			} else {
@@ -707,7 +707,7 @@ static void annotate_browser__mark_jump_targets(struct annotate_browser *browser
 			continue;
 
 		bdlt = disasm_line__browser(dlt);
-		bdlt->jump_target = true;
+		++bdlt->jump_sources;
 	}
 		
 }