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