Loading...
1#ifndef __PERF_REGS_H
2#define __PERF_REGS_H
3
4#include <linux/types.h>
5#include <linux/compiler.h>
6
7struct regs_dump;
8
9struct sample_reg {
10 const char *name;
11 uint64_t mask;
12};
13#define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
14#define SMPL_REG_END { .name = NULL }
15
16extern const struct sample_reg sample_reg_masks[];
17
18#ifdef HAVE_PERF_REGS_SUPPORT
19#include <perf_regs.h>
20
21int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
22
23#else
24#define PERF_REGS_MASK 0
25#define PERF_REGS_MAX 0
26
27static inline const char *perf_reg_name(int id __maybe_unused)
28{
29 return NULL;
30}
31
32static inline int perf_reg_value(u64 *valp __maybe_unused,
33 struct regs_dump *regs __maybe_unused,
34 int id __maybe_unused)
35{
36 return 0;
37}
38#endif /* HAVE_PERF_REGS_SUPPORT */
39#endif /* __PERF_REGS_H */
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __PERF_REGS_H
3#define __PERF_REGS_H
4
5#include <linux/types.h>
6#include <linux/compiler.h>
7
8struct regs_dump;
9
10struct sample_reg {
11 const char *name;
12 uint64_t mask;
13};
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
18extern const struct sample_reg sample_reg_masks[];
19
20enum {
21 SDT_ARG_VALID = 0,
22 SDT_ARG_SKIP,
23};
24
25int arch_sdt_arg_parse_op(char *old_op, char **new_op);
26uint64_t arch__intr_reg_mask(void);
27uint64_t arch__user_reg_mask(void);
28
29#ifdef HAVE_PERF_REGS_SUPPORT
30#include <perf_regs.h>
31
32#define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
33
34int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
35
36#else
37#define PERF_REGS_MASK 0
38#define PERF_REGS_MAX 0
39
40#define DWARF_MINIMAL_REGS PERF_REGS_MASK
41
42static inline const char *perf_reg_name(int id __maybe_unused)
43{
44 return NULL;
45}
46
47static inline int perf_reg_value(u64 *valp __maybe_unused,
48 struct regs_dump *regs __maybe_unused,
49 int id __maybe_unused)
50{
51 return 0;
52}
53#endif /* HAVE_PERF_REGS_SUPPORT */
54#endif /* __PERF_REGS_H */