perf_regs.h 894 字节
Newer Older
1 2 3
#ifndef __PERF_REGS_H
#define __PERF_REGS_H

B
Borislav Petkov 已提交
4
#include <linux/types.h>
5
#include <linux/compiler.h>
6 7

struct regs_dump;
8

9 10 11 12
struct sample_reg {
	const char *name;
	uint64_t mask;
};
13 14
#define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
#define SMPL_REG_END { .name = NULL }
15 16 17

extern const struct sample_reg sample_reg_masks[];

18 19 20 21 22 23
enum {
	SDT_ARG_VALID = 0,
	SDT_ARG_SKIP,
};

int arch_sdt_arg_parse_op(char *old_op, char **new_op);
24

25
#ifdef HAVE_PERF_REGS_SUPPORT
26
#include <perf_regs.h>
27 28 29

int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);

30 31
#else
#define PERF_REGS_MASK	0
32
#define PERF_REGS_MAX	0
33

34
static inline const char *perf_reg_name(int id __maybe_unused)
35 36 37
{
	return NULL;
}
38 39 40 41 42 43 44

static inline int perf_reg_value(u64 *valp __maybe_unused,
				 struct regs_dump *regs __maybe_unused,
				 int id __maybe_unused)
{
	return 0;
}
45
#endif /* HAVE_PERF_REGS_SUPPORT */
46
#endif /* __PERF_REGS_H */