Merge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / perf / util / perf_regs.h
bloba4549912618443cbc3e4f79d94a3861187f25b7a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_REGS_H
3 #define __PERF_REGS_H
5 #include <linux/types.h>
6 #include <linux/compiler.h>
8 struct regs_dump;
10 struct sample_reg {
11 const char *name;
12 uint64_t mask;
14 #define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
15 #define SMPL_REG2(n, b) { .name = #n, .mask = 3ULL << (b) }
16 #define SMPL_REG_END { .name = NULL }
18 enum {
19 SDT_ARG_VALID = 0,
20 SDT_ARG_SKIP,
23 int arch_sdt_arg_parse_op(char *old_op, char **new_op);
24 uint64_t arch__intr_reg_mask(void);
25 uint64_t arch__user_reg_mask(void);
27 #ifdef HAVE_PERF_REGS_SUPPORT
28 extern const struct sample_reg sample_reg_masks[];
30 #include <perf_regs.h>
32 #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
34 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
36 #else
37 #define PERF_REGS_MASK 0
38 #define PERF_REGS_MAX 0
40 #define DWARF_MINIMAL_REGS PERF_REGS_MASK
42 static inline const char *perf_reg_name(int id __maybe_unused)
44 return "unknown";
47 static inline int perf_reg_value(u64 *valp __maybe_unused,
48 struct regs_dump *regs __maybe_unused,
49 int id __maybe_unused)
51 return 0;
53 #endif /* HAVE_PERF_REGS_SUPPORT */
54 #endif /* __PERF_REGS_H */