Jiri Olsa | 2bcd355 | 2012-08-07 15:20:43 +0200 | [diff] [blame] | 1 | #ifndef __PERF_REGS_H |
| 2 | #define __PERF_REGS_H |
| 3 | |
Borislav Petkov | d944c4e | 2014-04-25 21:31:02 +0200 | [diff] [blame] | 4 | #include <linux/types.h> |
Jiri Olsa | 0c4e774 | 2014-04-17 19:39:10 +0200 | [diff] [blame] | 5 | |
| 6 | struct regs_dump; |
Jiri Olsa | c9b951c | 2014-01-07 13:47:29 +0100 | [diff] [blame] | 7 | |
Stephane Eranian | c5e991e | 2015-08-31 18:41:11 +0200 | [diff] [blame] | 8 | struct sample_reg { |
| 9 | const char *name; |
| 10 | uint64_t mask; |
| 11 | }; |
Stephane Eranian | af4aead | 2015-09-01 11:30:14 +0200 | [diff] [blame] | 12 | #define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) } |
| 13 | #define SMPL_REG_END { .name = NULL } |
Stephane Eranian | c5e991e | 2015-08-31 18:41:11 +0200 | [diff] [blame] | 14 | |
| 15 | extern const struct sample_reg sample_reg_masks[]; |
| 16 | |
Ingo Molnar | 89fe808 | 2013-09-30 12:07:11 +0200 | [diff] [blame] | 17 | #ifdef HAVE_PERF_REGS_SUPPORT |
Jiri Olsa | 2bcd355 | 2012-08-07 15:20:43 +0200 | [diff] [blame] | 18 | #include <perf_regs.h> |
Jiri Olsa | c9b951c | 2014-01-07 13:47:29 +0100 | [diff] [blame] | 19 | |
| 20 | int perf_reg_value(u64 *valp, struct regs_dump *regs, int id); |
| 21 | |
Jiri Olsa | 2bcd355 | 2012-08-07 15:20:43 +0200 | [diff] [blame] | 22 | #else |
| 23 | #define PERF_REGS_MASK 0 |
Jiri Olsa | 0c4e774 | 2014-04-17 19:39:10 +0200 | [diff] [blame] | 24 | #define PERF_REGS_MAX 0 |
Jiri Olsa | 2bcd355 | 2012-08-07 15:20:43 +0200 | [diff] [blame] | 25 | |
Irina Tirdea | 1d037ca | 2012-09-11 01:15:03 +0300 | [diff] [blame] | 26 | static inline const char *perf_reg_name(int id __maybe_unused) |
Jiri Olsa | 2bcd355 | 2012-08-07 15:20:43 +0200 | [diff] [blame] | 27 | { |
| 28 | return NULL; |
| 29 | } |
Jiri Olsa | c9b951c | 2014-01-07 13:47:29 +0100 | [diff] [blame] | 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 | } |
Ingo Molnar | 89fe808 | 2013-09-30 12:07:11 +0200 | [diff] [blame] | 37 | #endif /* HAVE_PERF_REGS_SUPPORT */ |
Jiri Olsa | 2bcd355 | 2012-08-07 15:20:43 +0200 | [diff] [blame] | 38 | #endif /* __PERF_REGS_H */ |