hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/tools/perf/arch/x86/include/perf_regs.h
....@@ -8,9 +8,9 @@
88
99 void perf_regs_load(u64 *regs);
1010
11
+#define PERF_REGS_MAX PERF_REG_X86_XMM_MAX
1112 #ifndef HAVE_ARCH_X86_64_SUPPORT
1213 #define PERF_REGS_MASK ((1ULL << PERF_REG_X86_32_MAX) - 1)
13
-#define PERF_REGS_MAX PERF_REG_X86_32_MAX
1414 #define PERF_SAMPLE_REGS_ABI PERF_SAMPLE_REGS_ABI_32
1515 #else
1616 #define REG_NOSUPPORT ((1ULL << PERF_REG_X86_DS) | \
....@@ -18,13 +18,12 @@
1818 (1ULL << PERF_REG_X86_FS) | \
1919 (1ULL << PERF_REG_X86_GS))
2020 #define PERF_REGS_MASK (((1ULL << PERF_REG_X86_64_MAX) - 1) & ~REG_NOSUPPORT)
21
-#define PERF_REGS_MAX PERF_REG_X86_64_MAX
2221 #define PERF_SAMPLE_REGS_ABI PERF_SAMPLE_REGS_ABI_64
2322 #endif
2423 #define PERF_REG_IP PERF_REG_X86_IP
2524 #define PERF_REG_SP PERF_REG_X86_SP
2625
27
-static inline const char *perf_reg_name(int id)
26
+static inline const char *__perf_reg_name(int id)
2827 {
2928 switch (id) {
3029 case PERF_REG_X86_AX:
....@@ -77,6 +76,28 @@
7776 case PERF_REG_X86_R15:
7877 return "R15";
7978 #endif /* HAVE_ARCH_X86_64_SUPPORT */
79
+
80
+#define XMM(x) \
81
+ case PERF_REG_X86_XMM ## x: \
82
+ case PERF_REG_X86_XMM ## x + 1: \
83
+ return "XMM" #x;
84
+ XMM(0)
85
+ XMM(1)
86
+ XMM(2)
87
+ XMM(3)
88
+ XMM(4)
89
+ XMM(5)
90
+ XMM(6)
91
+ XMM(7)
92
+ XMM(8)
93
+ XMM(9)
94
+ XMM(10)
95
+ XMM(11)
96
+ XMM(12)
97
+ XMM(13)
98
+ XMM(14)
99
+ XMM(15)
100
+#undef XMM
80101 default:
81102 return NULL;
82103 }