pmu.h 940 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __PMU_H
  2. #define __PMU_H
  3. #include <linux/bitops.h>
  4. #include "../../../include/linux/perf_event.h"
  5. enum {
  6. PERF_PMU_FORMAT_VALUE_CONFIG,
  7. PERF_PMU_FORMAT_VALUE_CONFIG1,
  8. PERF_PMU_FORMAT_VALUE_CONFIG2,
  9. };
  10. #define PERF_PMU_FORMAT_BITS 64
  11. struct perf_pmu__format {
  12. char *name;
  13. int value;
  14. DECLARE_BITMAP(bits, PERF_PMU_FORMAT_BITS);
  15. struct list_head list;
  16. };
  17. struct perf_pmu {
  18. char *name;
  19. __u32 type;
  20. struct list_head format;
  21. struct list_head list;
  22. };
  23. struct perf_pmu *perf_pmu__find(char *name);
  24. int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
  25. struct list_head *head_terms);
  26. int perf_pmu_wrap(void);
  27. void perf_pmu_error(struct list_head *list, char *name, char const *msg);
  28. int perf_pmu__new_format(struct list_head *list, char *name,
  29. int config, unsigned long *bits);
  30. void perf_pmu__set_format(unsigned long *bits, long from, long to);
  31. int perf_pmu__test(void);
  32. #endif /* __PMU_H */