arm_brbe.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Branch Record Buffer Extension Helpers.
  4. *
  5. * Copyright (C) 2022-2025 ARM Limited
  6. *
  7. * Author: Anshuman Khandual <anshuman.khandual@arm.com>
  8. */
  9. struct arm_pmu;
  10. struct perf_branch_stack;
  11. struct perf_event;
  12. #ifdef CONFIG_ARM64_BRBE
  13. void brbe_probe(struct arm_pmu *arm_pmu);
  14. unsigned int brbe_num_branch_records(const struct arm_pmu *armpmu);
  15. void brbe_invalidate(void);
  16. void brbe_enable(const struct arm_pmu *arm_pmu);
  17. void brbe_disable(void);
  18. bool brbe_branch_attr_valid(struct perf_event *event);
  19. void brbe_read_filtered_entries(struct perf_branch_stack *branch_stack,
  20. const struct perf_event *event);
  21. #else
  22. static inline void brbe_probe(struct arm_pmu *arm_pmu) { }
  23. static inline unsigned int brbe_num_branch_records(const struct arm_pmu *armpmu)
  24. {
  25. return 0;
  26. }
  27. static inline void brbe_invalidate(void) { }
  28. static inline void brbe_enable(const struct arm_pmu *arm_pmu) { };
  29. static inline void brbe_disable(void) { };
  30. static inline bool brbe_branch_attr_valid(struct perf_event *event)
  31. {
  32. WARN_ON_ONCE(!has_branch_stack(event));
  33. return false;
  34. }
  35. static void brbe_read_filtered_entries(struct perf_branch_stack *branch_stack,
  36. const struct perf_event *event)
  37. {
  38. }
  39. #endif