Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __PERF_REGS_H
0003 #define __PERF_REGS_H
0004 
0005 #include <linux/types.h>
0006 #include <linux/compiler.h>
0007 
0008 struct regs_dump;
0009 
0010 struct sample_reg {
0011     const char *name;
0012     uint64_t mask;
0013 };
0014 
0015 #define SMPL_REG_MASK(b) (1ULL << (b))
0016 #define SMPL_REG(n, b) { .name = #n, .mask = SMPL_REG_MASK(b) }
0017 #define SMPL_REG2_MASK(b) (3ULL << (b))
0018 #define SMPL_REG2(n, b) { .name = #n, .mask = SMPL_REG2_MASK(b) }
0019 #define SMPL_REG_END { .name = NULL }
0020 
0021 enum {
0022     SDT_ARG_VALID = 0,
0023     SDT_ARG_SKIP,
0024 };
0025 
0026 int arch_sdt_arg_parse_op(char *old_op, char **new_op);
0027 uint64_t arch__intr_reg_mask(void);
0028 uint64_t arch__user_reg_mask(void);
0029 
0030 #ifdef HAVE_PERF_REGS_SUPPORT
0031 extern const struct sample_reg sample_reg_masks[];
0032 
0033 #include <perf_regs.h>
0034 
0035 #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
0036 
0037 const char *perf_reg_name(int id, const char *arch);
0038 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
0039 
0040 #else
0041 #define PERF_REGS_MASK  0
0042 #define PERF_REGS_MAX   0
0043 
0044 #define DWARF_MINIMAL_REGS PERF_REGS_MASK
0045 
0046 static inline const char *perf_reg_name(int id __maybe_unused, const char *arch __maybe_unused)
0047 {
0048     return "unknown";
0049 }
0050 
0051 static inline int perf_reg_value(u64 *valp __maybe_unused,
0052                  struct regs_dump *regs __maybe_unused,
0053                  int id __maybe_unused)
0054 {
0055     return 0;
0056 }
0057 #endif /* HAVE_PERF_REGS_SUPPORT */
0058 #endif /* __PERF_REGS_H */