summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/ui/browsers/annotate.c13
-rw-r--r--tools/perf/util/annotate.c10
-rw-r--r--tools/perf/util/annotate.h4
3 files changed, 25 insertions, 2 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 46ef966ccc5b..f7d2db3e8464 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -83,7 +83,7 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro
else if (dl->offset == -1)
slsmg_write_nstring(dl->line, width - 18);
else {
- char bf[64];
+ char bf[256], *line = dl->line;
u64 addr = dl->offset;
int printed, color = -1;
@@ -96,7 +96,16 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro
slsmg_write_nstring(bf, printed);
if (change_color)
ui_browser__set_color(self, color);
- slsmg_write_nstring(dl->line, width - 18 - printed);
+ if (dl->ins && dl->ins->ops->scnprintf) {
+ dl->ins->ops->scnprintf(dl->ins, bf, sizeof(bf),
+ !ab->use_offset ? dl->operands : NULL,
+ dl->target);
+ line = bf;
+ slsmg_write_nstring(" ", 7);
+ printed += 7;
+ }
+
+ slsmg_write_nstring(line, width - 18 - printed);
}
if (current_entry)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index a4296fdd9a68..ed1f89d7044e 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -44,8 +44,18 @@ static int jump_ops__parse_target(const char *operands, u64 *target)
return 0;
}
+static int jump_ops__scnprintf(struct ins *ins, char *bf, size_t size,
+ const char *operands, u64 target)
+{
+ if (operands)
+ return scnprintf(bf, size, "%-6.6s %s", ins->name, operands);
+
+ return scnprintf(bf, size, "%-6.6s %" PRIx64, ins->name, target);
+}
+
static struct ins_ops jump_ops = {
.parse_target = jump_ops__parse_target,
+ .scnprintf = jump_ops__scnprintf,
};
bool ins__is_jump(const struct ins *ins)
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index a2105f204a42..6314335007f0 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -7,8 +7,12 @@
#include <linux/list.h>
#include <linux/rbtree.h>
+struct ins;
+
struct ins_ops {
int (*parse_target)(const char *operands, u64 *target);
+ int (*scnprintf)(struct ins *ins, char *bf, size_t size,
+ const char *operands, u64 target);
};
struct ins {
OpenPOWER on IntegriCloud