pmu.c 512 B

123456789101112131415161718192021
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <string.h>
  3. #include <linux/stddef.h>
  4. #include <linux/perf_event.h>
  5. #include "../../util/intel-pt.h"
  6. #include "../../util/intel-bts.h"
  7. #include "../../util/pmu.h"
  8. struct perf_event_attr *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused)
  9. {
  10. #ifdef HAVE_AUXTRACE_SUPPORT
  11. if (!strcmp(pmu->name, INTEL_PT_PMU_NAME))
  12. return intel_pt_pmu_default_config(pmu);
  13. if (!strcmp(pmu->name, INTEL_BTS_PMU_NAME))
  14. pmu->selectable = true;
  15. #endif
  16. return NULL;
  17. }