perf_regs.h 763 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __PERF_REGS_H
  2. #define __PERF_REGS_H
  3. #include <linux/types.h>
  4. struct regs_dump;
  5. struct sample_reg {
  6. const char *name;
  7. uint64_t mask;
  8. };
  9. #define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
  10. #define SMPL_REG_END { .name = NULL }
  11. extern const struct sample_reg sample_reg_masks[];
  12. #ifdef HAVE_PERF_REGS_SUPPORT
  13. #include <perf_regs.h>
  14. int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
  15. #else
  16. #define PERF_REGS_MASK 0
  17. #define PERF_REGS_MAX 0
  18. static inline const char *perf_reg_name(int id __maybe_unused)
  19. {
  20. return NULL;
  21. }
  22. static inline int perf_reg_value(u64 *valp __maybe_unused,
  23. struct regs_dump *regs __maybe_unused,
  24. int id __maybe_unused)
  25. {
  26. return 0;
  27. }
  28. #endif /* HAVE_PERF_REGS_SUPPORT */
  29. #endif /* __PERF_REGS_H */