perf_regs.h 791 B

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