Skip to contentSkip to conversation

perf annotate browser: Add visual cue for retq instruction

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

lore
Share & tools
lore
#0 lore raw
Commit-ID:  4ea08b522071c6c34098b7a880aac3551abecd75
Gitweb:     http://git.kernel.org/tip/4ea08b522071c6c34098b7a880aac3551abecd75
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 20 Apr 2012 15:51:40 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 20 Apr 2012 15:51:40 -0300

perf annotate browser: Add visual cue for retq instruction

Just use a left arrow prefixing retqs.

Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Linus Torvalds <[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 |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
tools/perf/ui/browsers/annotate.c +13 -4
index 63206ca..d0c606e 100644
@@ -127,11 +127,20 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro
 
 			dl->ins->ops->scnprintf(dl->ins, bf, sizeof(bf), &dl->ops,
 						!ab->use_offset);
-			printed += 2;
-		} else
-			scnprintf(bf, sizeof(bf), "  %-6.6s %s", dl->name, dl->ops.raw);
+		} else {
+			if (strcmp(dl->name, "retq")) {
+				slsmg_write_nstring(" ", 2);
+			} else {
+				SLsmg_set_char_set(1);
+				SLsmg_write_char(SLSMG_LARROW_CHAR);
+				SLsmg_set_char_set(0);
+				SLsmg_write_char(' ');
+			}
+
+			scnprintf(bf, sizeof(bf), "%-6.6s %s", dl->name, dl->ops.raw);
+		}
 
-		slsmg_write_nstring(bf, width - 10 - printed);
+		slsmg_write_nstring(bf, width - 12 - printed);
 	}
 
 	if (current_entry)