probe.h 710 B

123456789101112131415161718192021222324252627282930
  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. struct perf_msr {
  6. u64 msr;
  7. struct attribute_group *grp;
  8. bool (*test)(int idx, void *data);
  9. bool no_check;
  10. u64 mask;
  11. };
  12. unsigned long
  13. perf_msr_probe(struct perf_msr *msr, int cnt, bool no_zero, void *data);
  14. #define __PMU_EVENT_GROUP(_name) \
  15. static struct attribute *attrs_##_name[] = { \
  16. &attr_##_name.attr.attr, \
  17. NULL, \
  18. }
  19. #define PMU_EVENT_GROUP(_grp, _name) \
  20. __PMU_EVENT_GROUP(_name); \
  21. static struct attribute_group group_##_name = { \
  22. .name = #_grp, \
  23. .attrs = attrs_##_name, \
  24. }
  25. #endif /* __ARCH_X86_EVENTS_PROBE_H__ */