xref: /openbmc/linux/tools/perf/util/perf_regs.h (revision a2cce7a9)
1 #ifndef __PERF_REGS_H
2 #define __PERF_REGS_H
3 
4 #include <linux/types.h>
5 
6 struct regs_dump;
7 
8 struct sample_reg {
9 	const char *name;
10 	uint64_t mask;
11 };
12 #define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
13 #define SMPL_REG_END { .name = NULL }
14 
15 extern const struct sample_reg sample_reg_masks[];
16 
17 #ifdef HAVE_PERF_REGS_SUPPORT
18 #include <perf_regs.h>
19 
20 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
21 
22 #else
23 #define PERF_REGS_MASK	0
24 #define PERF_REGS_MAX	0
25 
26 static inline const char *perf_reg_name(int id __maybe_unused)
27 {
28 	return NULL;
29 }
30 
31 static inline int perf_reg_value(u64 *valp __maybe_unused,
32 				 struct regs_dump *regs __maybe_unused,
33 				 int id __maybe_unused)
34 {
35 	return 0;
36 }
37 #endif /* HAVE_PERF_REGS_SUPPORT */
38 #endif /* __PERF_REGS_H */
39