1 // SPDX-License-Identifier: GPL-2.0 2 3 #include "../perf_regs.h" 4 #include "../../../arch/x86/include/uapi/asm/perf_regs.h" 5 __perf_reg_name_x86(int id)6const char *__perf_reg_name_x86(int id) 7 { 8 switch (id) { 9 case PERF_REG_X86_AX: 10 return "AX"; 11 case PERF_REG_X86_BX: 12 return "BX"; 13 case PERF_REG_X86_CX: 14 return "CX"; 15 case PERF_REG_X86_DX: 16 return "DX"; 17 case PERF_REG_X86_SI: 18 return "SI"; 19 case PERF_REG_X86_DI: 20 return "DI"; 21 case PERF_REG_X86_BP: 22 return "BP"; 23 case PERF_REG_X86_SP: 24 return "SP"; 25 case PERF_REG_X86_IP: 26 return "IP"; 27 case PERF_REG_X86_FLAGS: 28 return "FLAGS"; 29 case PERF_REG_X86_CS: 30 return "CS"; 31 case PERF_REG_X86_SS: 32 return "SS"; 33 case PERF_REG_X86_DS: 34 return "DS"; 35 case PERF_REG_X86_ES: 36 return "ES"; 37 case PERF_REG_X86_FS: 38 return "FS"; 39 case PERF_REG_X86_GS: 40 return "GS"; 41 case PERF_REG_X86_R8: 42 return "R8"; 43 case PERF_REG_X86_R9: 44 return "R9"; 45 case PERF_REG_X86_R10: 46 return "R10"; 47 case PERF_REG_X86_R11: 48 return "R11"; 49 case PERF_REG_X86_R12: 50 return "R12"; 51 case PERF_REG_X86_R13: 52 return "R13"; 53 case PERF_REG_X86_R14: 54 return "R14"; 55 case PERF_REG_X86_R15: 56 return "R15"; 57 58 #define XMM(x) \ 59 case PERF_REG_X86_XMM ## x: \ 60 case PERF_REG_X86_XMM ## x + 1: \ 61 return "XMM" #x; 62 XMM(0) 63 XMM(1) 64 XMM(2) 65 XMM(3) 66 XMM(4) 67 XMM(5) 68 XMM(6) 69 XMM(7) 70 XMM(8) 71 XMM(9) 72 XMM(10) 73 XMM(11) 74 XMM(12) 75 XMM(13) 76 XMM(14) 77 XMM(15) 78 #undef XMM 79 default: 80 return NULL; 81 } 82 83 return NULL; 84 } 85 __perf_reg_ip_x86(void)86uint64_t __perf_reg_ip_x86(void) 87 { 88 return PERF_REG_X86_IP; 89 } 90 __perf_reg_sp_x86(void)91uint64_t __perf_reg_sp_x86(void) 92 { 93 return PERF_REG_X86_SP; 94 } 95