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

Borislav Petkov's avatar
Borislav Petkov committed
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 15 16 17 18

#define SMPL_REG_MASK(b) (1ULL << (b))
#define SMPL_REG(n, b) { .name = #n, .mask = SMPL_REG_MASK(b) }
#define SMPL_REG2_MASK(b) (3ULL << (b))
#define SMPL_REG2(n, b) { .name = #n, .mask = SMPL_REG2_MASK(b) }
19
#define SMPL_REG_END { .name = NULL }
20

21 22 23 24 25 26
enum {
	SDT_ARG_VALID = 0,
	SDT_ARG_SKIP,
};

int arch_sdt_arg_parse_op(char *old_op, char **new_op);
27 28
uint64_t arch__intr_reg_mask(void);
uint64_t arch__user_reg_mask(void);
29
const struct sample_reg *arch__sample_reg_masks(void);
30

31
const char *perf_reg_name(int id, const char *arch);
32
int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
33 34
uint64_t perf_arch_reg_ip(const char *arch);
uint64_t perf_arch_reg_sp(const char *arch);
35
const char *__perf_reg_name_arm64(int id);
36 37
uint64_t __perf_reg_ip_arm64(void);
uint64_t __perf_reg_sp_arm64(void);
38
const char *__perf_reg_name_arm(int id);
39 40
uint64_t __perf_reg_ip_arm(void);
uint64_t __perf_reg_sp_arm(void);
41
const char *__perf_reg_name_csky(int id);
42 43
uint64_t __perf_reg_ip_csky(void);
uint64_t __perf_reg_sp_csky(void);
44
const char *__perf_reg_name_loongarch(int id);
45 46
uint64_t __perf_reg_ip_loongarch(void);
uint64_t __perf_reg_sp_loongarch(void);
47
const char *__perf_reg_name_mips(int id);
48 49
uint64_t __perf_reg_ip_mips(void);
uint64_t __perf_reg_sp_mips(void);
50
const char *__perf_reg_name_powerpc(int id);
51 52
uint64_t __perf_reg_ip_powerpc(void);
uint64_t __perf_reg_sp_powerpc(void);
53
const char *__perf_reg_name_riscv(int id);
54 55
uint64_t __perf_reg_ip_riscv(void);
uint64_t __perf_reg_sp_riscv(void);
56
const char *__perf_reg_name_s390(int id);
57 58
uint64_t __perf_reg_ip_s390(void);
uint64_t __perf_reg_sp_s390(void);
59
const char *__perf_reg_name_x86(int id);
60 61 62 63 64 65 66
uint64_t __perf_reg_ip_x86(void);
uint64_t __perf_reg_sp_x86(void);

static inline uint64_t DWARF_MINIMAL_REGS(const char *arch)
{
	return (1ULL << perf_arch_reg_ip(arch)) | (1ULL << perf_arch_reg_sp(arch));
}
67

68
#endif /* __PERF_REGS_H */