1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/types.h>
6 #include <linux/compiler.h>
15 #define SMPL_REG_MASK(b) (1ULL << (b))
16 #define SMPL_REG(n, b) { .name = #n, .mask = SMPL_REG_MASK(b) }
17 #define SMPL_REG2_MASK(b) (3ULL << (b))
18 #define SMPL_REG2(n, b) { .name = #n, .mask = SMPL_REG2_MASK(b) }
19 #define SMPL_REG_END { .name = NULL }
26 int arch_sdt_arg_parse_op(char *old_op, char **new_op);
27 uint64_t arch__intr_reg_mask(void);
28 uint64_t arch__user_reg_mask(void);
30 #ifdef HAVE_PERF_REGS_SUPPORT
31 extern const struct sample_reg sample_reg_masks[];
33 const char *perf_reg_name(int id, const char *arch);
34 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
35 uint64_t perf_arch_reg_ip(const char *arch);
36 uint64_t perf_arch_reg_sp(const char *arch);
37 const char *__perf_reg_name_arm64(int id);
38 uint64_t __perf_reg_ip_arm64(void);
39 uint64_t __perf_reg_sp_arm64(void);
40 const char *__perf_reg_name_arm(int id);
41 uint64_t __perf_reg_ip_arm(void);
42 uint64_t __perf_reg_sp_arm(void);
43 const char *__perf_reg_name_csky(int id);
44 uint64_t __perf_reg_ip_csky(void);
45 uint64_t __perf_reg_sp_csky(void);
46 const char *__perf_reg_name_loongarch(int id);
47 uint64_t __perf_reg_ip_loongarch(void);
48 uint64_t __perf_reg_sp_loongarch(void);
49 const char *__perf_reg_name_mips(int id);
50 uint64_t __perf_reg_ip_mips(void);
51 uint64_t __perf_reg_sp_mips(void);
52 const char *__perf_reg_name_powerpc(int id);
53 uint64_t __perf_reg_ip_powerpc(void);
54 uint64_t __perf_reg_sp_powerpc(void);
55 const char *__perf_reg_name_riscv(int id);
56 uint64_t __perf_reg_ip_riscv(void);
57 uint64_t __perf_reg_sp_riscv(void);
58 const char *__perf_reg_name_s390(int id);
59 uint64_t __perf_reg_ip_s390(void);
60 uint64_t __perf_reg_sp_s390(void);
61 const char *__perf_reg_name_x86(int id);
62 uint64_t __perf_reg_ip_x86(void);
63 uint64_t __perf_reg_sp_x86(void);
65 static inline uint64_t DWARF_MINIMAL_REGS(const char *arch)
67 return (1ULL << perf_arch_reg_ip(arch)) | (1ULL << perf_arch_reg_sp(arch));
72 static inline uint64_t DWARF_MINIMAL_REGS(const char *arch __maybe_unused)
77 static inline const char *perf_reg_name(int id __maybe_unused, const char *arch __maybe_unused)
82 static inline int perf_reg_value(u64 *valp __maybe_unused,
83 struct regs_dump *regs __maybe_unused,
84 int id __maybe_unused)
89 static inline uint64_t perf_arch_reg_ip(const char *arch __maybe_unused)
94 static inline uint64_t perf_arch_reg_sp(const char *arch __maybe_unused)
99 #endif /* HAVE_PERF_REGS_SUPPORT */
100 #endif /* __PERF_REGS_H */