Linux 5.1.15
[linux/fpc-iii.git] / tools / perf / util / perf_regs.h
blobc9319f8d17a6accc7267fedf6abb12ac99c873b2
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_REG_END { .name = NULL }
17 extern const struct sample_reg sample_reg_masks[];
19 enum {
20 SDT_ARG_VALID = 0,
21 SDT_ARG_SKIP,
24 int arch_sdt_arg_parse_op(char *old_op, char **new_op);
26 #ifdef HAVE_PERF_REGS_SUPPORT
27 #include <perf_regs.h>
29 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
31 #else
32 #define PERF_REGS_MASK 0
33 #define PERF_REGS_MAX 0
35 static inline const char *perf_reg_name(int id __maybe_unused)
37 return NULL;
40 static inline int perf_reg_value(u64 *valp __maybe_unused,
41 struct regs_dump *regs __maybe_unused,
42 int id __maybe_unused)
44 return 0;
46 #endif /* HAVE_PERF_REGS_SUPPORT */
47 #endif /* __PERF_REGS_H */