xref: /linux/arch/x86/events/probe.h (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
198253a54SJiri Olsa /* SPDX-License-Identifier: GPL-2.0 */
298253a54SJiri Olsa #ifndef __ARCH_X86_EVENTS_PROBE_H__
398253a54SJiri Olsa #define __ARCH_X86_EVENTS_PROBE_H__
498253a54SJiri Olsa #include <linux/sysfs.h>
598253a54SJiri Olsa 
698253a54SJiri Olsa struct perf_msr {
798253a54SJiri Olsa 	u64			msr;
898253a54SJiri Olsa 	struct attribute_group	*grp;
998253a54SJiri Olsa 	bool			(*test)(int idx, void *data);
1098253a54SJiri Olsa 	bool			no_check;
11*ffb20c2eSZhang Rui 	u64			mask;
1298253a54SJiri Olsa };
1398253a54SJiri Olsa 
1498253a54SJiri Olsa unsigned long
1598253a54SJiri Olsa perf_msr_probe(struct perf_msr *msr, int cnt, bool no_zero, void *data);
1698253a54SJiri Olsa 
1798253a54SJiri Olsa #define __PMU_EVENT_GROUP(_name)			\
1898253a54SJiri Olsa static struct attribute *attrs_##_name[] = {		\
1998253a54SJiri Olsa 	&attr_##_name.attr.attr,			\
2098253a54SJiri Olsa 	NULL,						\
2198253a54SJiri Olsa }
2298253a54SJiri Olsa 
2398253a54SJiri Olsa #define PMU_EVENT_GROUP(_grp, _name)			\
2498253a54SJiri Olsa __PMU_EVENT_GROUP(_name);				\
2598253a54SJiri Olsa static struct attribute_group group_##_name = {		\
2698253a54SJiri Olsa 	.name  = #_grp,					\
2798253a54SJiri Olsa 	.attrs = attrs_##_name,				\
2898253a54SJiri Olsa }
2998253a54SJiri Olsa 
3098253a54SJiri Olsa #endif /* __ARCH_X86_EVENTS_PROBE_H__ */
31