pmu.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef __PMU_H
  2. #define __PMU_H
  3. #include <linux/bitops.h>
  4. #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__alias {
  18. char *name;
  19. struct list_head terms;
  20. struct list_head list;
  21. };
  22. struct perf_pmu {
  23. char *name;
  24. __u32 type;
  25. struct cpu_map *cpus;
  26. struct list_head format;
  27. struct list_head aliases;
  28. struct list_head list;
  29. };
  30. struct perf_pmu *perf_pmu__find(char *name);
  31. int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
  32. struct list_head *head_terms);
  33. int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms);
  34. struct list_head *perf_pmu__alias(struct perf_pmu *pmu,
  35. struct list_head *head_terms);
  36. int perf_pmu_wrap(void);
  37. void perf_pmu_error(struct list_head *list, char *name, char const *msg);
  38. int perf_pmu__new_format(struct list_head *list, char *name,
  39. int config, unsigned long *bits);
  40. void perf_pmu__set_format(unsigned long *bits, long from, long to);
  41. struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu);
  42. int perf_pmu__test(void);
  43. #endif /* __PMU_H */