perf_regs.h 938 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_REG_END { .name = NULL }
  13. extern const struct sample_reg sample_reg_masks[];
  14. enum {
  15. SDT_ARG_VALID = 0,
  16. SDT_ARG_SKIP,
  17. };
  18. int arch_sdt_arg_parse_op(char *old_op, char **new_op);
  19. #ifdef HAVE_PERF_REGS_SUPPORT
  20. #include <perf_regs.h>
  21. int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
  22. #else
  23. #define PERF_REGS_MASK 0
  24. #define PERF_REGS_MAX 0
  25. static inline const char *perf_reg_name(int id __maybe_unused)
  26. {
  27. return "unknown";
  28. }
  29. static inline int perf_reg_value(u64 *valp __maybe_unused,
  30. struct regs_dump *regs __maybe_unused,
  31. int id __maybe_unused)
  32. {
  33. return 0;
  34. }
  35. #endif /* HAVE_PERF_REGS_SUPPORT */
  36. #endif /* __PERF_REGS_H */