perf_regs.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __PERF_REGS_H
  3. #define __PERF_REGS_H
  4. #include <linux/types.h>
  5. #include <linux/compiler.h>
  6. struct regs_dump;
  7. struct sample_reg {
  8. const char *name;
  9. uint64_t mask;
  10. };
  11. #define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
  12. #define SMPL_REG2(n, b) { .name = #n, .mask = 3ULL << (b) }
  13. #define SMPL_REG_END { .name = NULL }
  14. extern const struct sample_reg sample_reg_masks[];
  15. enum {
  16. SDT_ARG_VALID = 0,
  17. SDT_ARG_SKIP,
  18. };
  19. int arch_sdt_arg_parse_op(char *old_op, char **new_op);
  20. uint64_t arch__intr_reg_mask(void);
  21. uint64_t arch__user_reg_mask(void);
  22. #ifdef HAVE_PERF_REGS_SUPPORT
  23. #include <perf_regs.h>
  24. #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
  25. int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
  26. #else
  27. #define PERF_REGS_MASK 0
  28. #define PERF_REGS_MAX 0
  29. #define DWARF_MINIMAL_REGS PERF_REGS_MASK
  30. static inline const char *perf_reg_name(int id __maybe_unused)
  31. {
  32. return "unknown";
  33. }
  34. static inline int perf_reg_value(u64 *valp __maybe_unused,
  35. struct regs_dump *regs __maybe_unused,
  36. int id __maybe_unused)
  37. {
  38. return 0;
  39. }
  40. #endif /* HAVE_PERF_REGS_SUPPORT */
  41. #endif /* __PERF_REGS_H */