pmu.c 748 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright(C) 2015 Linaro Limited. All rights reserved.
  4. * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
  5. */
  6. #include <string.h>
  7. #include <linux/coresight-pmu.h>
  8. #include <linux/perf_event.h>
  9. #include "cs-etm.h"
  10. #include "arm-spe.h"
  11. #include "../../util/pmu.h"
  12. struct perf_event_attr
  13. *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
  14. {
  15. #ifdef HAVE_AUXTRACE_SUPPORT
  16. if (!strcmp(pmu->name, CORESIGHT_ETM_PMU_NAME)) {
  17. /* add ETM default config here */
  18. pmu->selectable = true;
  19. pmu->set_drv_config = cs_etm_set_drv_config;
  20. #if defined(__aarch64__)
  21. } else if (strstarts(pmu->name, ARM_SPE_PMU_NAME)) {
  22. return arm_spe_pmu_default_config(pmu);
  23. #endif
  24. }
  25. #endif
  26. return NULL;
  27. }