perf_event.h 797 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_SH_PERF_EVENT_H
  3. #define __ASM_SH_PERF_EVENT_H
  4. struct hw_perf_event;
  5. #define MAX_HWEVENTS 2
  6. struct sh_pmu {
  7. const char *name;
  8. unsigned int num_events;
  9. void (*disable_all)(void);
  10. void (*enable_all)(void);
  11. void (*enable)(struct hw_perf_event *, int);
  12. void (*disable)(struct hw_perf_event *, int);
  13. u64 (*read)(int);
  14. int (*event_map)(int);
  15. unsigned int max_events;
  16. unsigned long raw_event_mask;
  17. const int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
  18. [PERF_COUNT_HW_CACHE_OP_MAX]
  19. [PERF_COUNT_HW_CACHE_RESULT_MAX];
  20. };
  21. /* arch/sh/kernel/perf_event.c */
  22. extern int register_sh_pmu(struct sh_pmu *);
  23. extern int reserve_pmc_hardware(void);
  24. extern void release_pmc_hardware(void);
  25. #endif /* __ASM_SH_PERF_EVENT_H */