perf_regs.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef ARCH_PERF_REGS_H
  3. #define ARCH_PERF_REGS_H
  4. #include <stdlib.h>
  5. #include <linux/types.h>
  6. #include <asm/perf_regs.h>
  7. void perf_regs_load(u64 *regs);
  8. #define PERF_REGS_MASK ((1ULL << PERF_REG_ARM_MAX) - 1)
  9. #define PERF_REGS_MAX PERF_REG_ARM_MAX
  10. #define PERF_SAMPLE_REGS_ABI PERF_SAMPLE_REGS_ABI_32
  11. #define PERF_REG_IP PERF_REG_ARM_PC
  12. #define PERF_REG_SP PERF_REG_ARM_SP
  13. static inline const char *perf_reg_name(int id)
  14. {
  15. switch (id) {
  16. case PERF_REG_ARM_R0:
  17. return "r0";
  18. case PERF_REG_ARM_R1:
  19. return "r1";
  20. case PERF_REG_ARM_R2:
  21. return "r2";
  22. case PERF_REG_ARM_R3:
  23. return "r3";
  24. case PERF_REG_ARM_R4:
  25. return "r4";
  26. case PERF_REG_ARM_R5:
  27. return "r5";
  28. case PERF_REG_ARM_R6:
  29. return "r6";
  30. case PERF_REG_ARM_R7:
  31. return "r7";
  32. case PERF_REG_ARM_R8:
  33. return "r8";
  34. case PERF_REG_ARM_R9:
  35. return "r9";
  36. case PERF_REG_ARM_R10:
  37. return "r10";
  38. case PERF_REG_ARM_FP:
  39. return "fp";
  40. case PERF_REG_ARM_IP:
  41. return "ip";
  42. case PERF_REG_ARM_SP:
  43. return "sp";
  44. case PERF_REG_ARM_LR:
  45. return "lr";
  46. case PERF_REG_ARM_PC:
  47. return "pc";
  48. default:
  49. return NULL;
  50. }
  51. return NULL;
  52. }
  53. #endif /* ARCH_PERF_REGS_H */