xref: /kernel/linux/linux-5.10/arch/x86/events/probe.h (revision 8c2ecf20)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ARCH_X86_EVENTS_PROBE_H__
3#define __ARCH_X86_EVENTS_PROBE_H__
4#include <linux/sysfs.h>
5
6struct perf_msr {
7	u64			  msr;
8	struct attribute_group	 *grp;
9	bool			(*test)(int idx, void *data);
10	bool			  no_check;
11};
12
13unsigned long
14perf_msr_probe(struct perf_msr *msr, int cnt, bool no_zero, void *data);
15
16#define __PMU_EVENT_GROUP(_name)			\
17static struct attribute *attrs_##_name[] = {		\
18	&attr_##_name.attr.attr,			\
19	NULL,						\
20}
21
22#define PMU_EVENT_GROUP(_grp, _name)			\
23__PMU_EVENT_GROUP(_name);				\
24static struct attribute_group group_##_name = {		\
25	.name  = #_grp,					\
26	.attrs = attrs_##_name,				\
27}
28
29#endif /* __ARCH_X86_EVENTS_PROBE_H__ */
30