perf_regs.h 1.2 KB
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
2 3 4
#ifndef __PERF_REGS_H
#define __PERF_REGS_H

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

struct regs_dump;
9

10 11 12 13
struct sample_reg {
	const char *name;
	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 }
17

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
uint64_t arch__intr_reg_mask(void);
uint64_t arch__user_reg_mask(void);
26

27
#ifdef HAVE_PERF_REGS_SUPPORT
28 29
extern const struct sample_reg sample_reg_masks[];

30
#include <perf_regs.h>
31

32 33
#define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))

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

36 37
#else
#define PERF_REGS_MASK	0
38
#define PERF_REGS_MAX	0
39

40 41
#define DWARF_MINIMAL_REGS PERF_REGS_MASK

42
static inline const char *perf_reg_name(int id __maybe_unused)
43
{
44
	return "unknown";
45
}
46 47 48 49 50 51 52

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