License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / tools / perf / util / perf_regs.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
2bcd355b
JO
2#ifndef __PERF_REGS_H
3#define __PERF_REGS_H
4
d944c4ee 5#include <linux/types.h>
9fb47654 6#include <linux/compiler.h>
0c4e774f
JO
7
8struct regs_dump;
c9b951c4 9
c5e991ee
SE
10struct sample_reg {
11 const char *name;
12 uint64_t mask;
13};
af4aeadd
SE
14#define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
15#define SMPL_REG_END { .name = NULL }
c5e991ee
SE
16
17extern const struct sample_reg sample_reg_masks[];
18
d451a205
RB
19enum {
20 SDT_ARG_VALID = 0,
21 SDT_ARG_SKIP,
22};
23
24int arch_sdt_arg_parse_op(char *old_op, char **new_op);
3b1f8311 25
89fe808a 26#ifdef HAVE_PERF_REGS_SUPPORT
2bcd355b 27#include <perf_regs.h>
c9b951c4
JO
28
29int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
30
2bcd355b
JO
31#else
32#define PERF_REGS_MASK 0
0c4e774f 33#define PERF_REGS_MAX 0
2bcd355b 34
1d037ca1 35static inline const char *perf_reg_name(int id __maybe_unused)
2bcd355b
JO
36{
37 return NULL;
38}
c9b951c4
JO
39
40static inline int perf_reg_value(u64 *valp __maybe_unused,
41 struct regs_dump *regs __maybe_unused,
42 int id __maybe_unused)
43{
44 return 0;
45}
89fe808a 46#endif /* HAVE_PERF_REGS_SUPPORT */
2bcd355b 47#endif /* __PERF_REGS_H */