1 #ifndef ARCH_PERF_REGS_H 2 #define ARCH_PERF_REGS_H 3 4 #include <stdlib.h> 5 #include <linux/types.h> 6 #include <asm/perf_regs.h> 7 8 #define PERF_REGS_MASK ((1ULL << PERF_REG_ARM64_MAX) - 1) 9 #define PERF_REGS_MAX PERF_REG_ARM64_MAX 10 11 #define PERF_REG_IP PERF_REG_ARM64_PC 12 #define PERF_REG_SP PERF_REG_ARM64_SP 13 14 static inline const char *perf_reg_name(int id) 15 { 16 switch (id) { 17 case PERF_REG_ARM64_X0: 18 return "x0"; 19 case PERF_REG_ARM64_X1: 20 return "x1"; 21 case PERF_REG_ARM64_X2: 22 return "x2"; 23 case PERF_REG_ARM64_X3: 24 return "x3"; 25 case PERF_REG_ARM64_X4: 26 return "x4"; 27 case PERF_REG_ARM64_X5: 28 return "x5"; 29 case PERF_REG_ARM64_X6: 30 return "x6"; 31 case PERF_REG_ARM64_X7: 32 return "x7"; 33 case PERF_REG_ARM64_X8: 34 return "x8"; 35 case PERF_REG_ARM64_X9: 36 return "x9"; 37 case PERF_REG_ARM64_X10: 38 return "x10"; 39 case PERF_REG_ARM64_X11: 40 return "x11"; 41 case PERF_REG_ARM64_X12: 42 return "x12"; 43 case PERF_REG_ARM64_X13: 44 return "x13"; 45 case PERF_REG_ARM64_X14: 46 return "x14"; 47 case PERF_REG_ARM64_X15: 48 return "x15"; 49 case PERF_REG_ARM64_X16: 50 return "x16"; 51 case PERF_REG_ARM64_X17: 52 return "x17"; 53 case PERF_REG_ARM64_X18: 54 return "x18"; 55 case PERF_REG_ARM64_X19: 56 return "x19"; 57 case PERF_REG_ARM64_X20: 58 return "x20"; 59 case PERF_REG_ARM64_X21: 60 return "x21"; 61 case PERF_REG_ARM64_X22: 62 return "x22"; 63 case PERF_REG_ARM64_X23: 64 return "x23"; 65 case PERF_REG_ARM64_X24: 66 return "x24"; 67 case PERF_REG_ARM64_X25: 68 return "x25"; 69 case PERF_REG_ARM64_X26: 70 return "x26"; 71 case PERF_REG_ARM64_X27: 72 return "x27"; 73 case PERF_REG_ARM64_X28: 74 return "x28"; 75 case PERF_REG_ARM64_X29: 76 return "x29"; 77 case PERF_REG_ARM64_SP: 78 return "sp"; 79 case PERF_REG_ARM64_LR: 80 return "lr"; 81 case PERF_REG_ARM64_PC: 82 return "pc"; 83 default: 84 return NULL; 85 } 86 87 return NULL; 88 } 89 90 #endif /* ARCH_PERF_REGS_H */ 91