[PATCH 6/7] perf annotate: Make action message be architecture specific
From: Chris Ryder
Date: Thu May 19 2016 - 13:00:58 EST
The help message displayed by perf report when pressing right arrow
or enter keys on an instruction that doesn't have an action is
currently hard coded and displays x86 instructions regardless of
the target architecture. Make the help message architecture specific.
Signed-off-by: Chris Ryder <chris.ryder@xxxxxxx>
Acked-by: Pawel Moll <pawel.moll@xxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: linux-perf-users@xxxxxxxxxxxxxxx
Cc: Will Deacon <will.deacon@xxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
---
tools/perf/arch/arm/include/annotate_ins.h | 2 ++
tools/perf/arch/x86/include/annotate_ins.h | 2 ++
tools/perf/ui/browsers/annotate.c | 2 +-
tools/perf/util/annotate_ins.h | 1 +
4 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/perf/arch/arm/include/annotate_ins.h b/tools/perf/arch/arm/include/annotate_ins.h
index e8ea98d..143c478 100644
--- a/tools/perf/arch/arm/include/annotate_ins.h
+++ b/tools/perf/arch/arm/include/annotate_ins.h
@@ -22,4 +22,6 @@
{ .name = "orr", .ops = &mov_ops, }, \
}
+#define ARCH_ACTIONS "Actions are only available for branch instructions."
+
#endif /* ARCH_ANNOTATE_INS_H */
diff --git a/tools/perf/arch/x86/include/annotate_ins.h b/tools/perf/arch/x86/include/annotate_ins.h
index 179b50e..2e889b8 100644
--- a/tools/perf/arch/x86/include/annotate_ins.h
+++ b/tools/perf/arch/x86/include/annotate_ins.h
@@ -79,4 +79,6 @@
{ .name = "xbeginq", .ops = &jump_ops, }, \
}
+#define ARCH_ACTIONS "Actions are only available for 'callq', 'retq' & jump instructions."
+
#endif /* ARCH_ANNOTATE_INS_H */
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 6816faf..56064f6 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -850,7 +850,7 @@ show_help:
} else if (!(annotate_browser__jump(browser) ||
annotate_browser__callq(browser, evsel, hbt))) {
show_sup_ins:
- ui_helpline__puts("Actions are only available for 'callq', 'retq' & jump instructions.");
+ ui_helpline__puts(ARCH_ACTIONS);
}
continue;
case 't':
diff --git a/tools/perf/util/annotate_ins.h b/tools/perf/util/annotate_ins.h
index 15ac482..27457f8f 100644
--- a/tools/perf/util/annotate_ins.h
+++ b/tools/perf/util/annotate_ins.h
@@ -11,6 +11,7 @@ extern char *arch_parse_call_target(char *t);
#include <annotate_ins.h>
#else
#define ARCH_INSTRUCTIONS { }
+#define ARCH_ACTIONS "Actions are not supported on this architecture"
#endif
#endif /* __ANNOTATE_INS_H */
--
2.1.4