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 7 #include <string.h> 8 #include <linux/coresight-pmu.h> 9 #include <linux/perf_event.h> 10 #include <linux/string.h> 11 12 #include "arm-spe.h" 13 #include "hisi-ptt.h" 14 #include "../../../util/pmu.h" 15 16 struct perf_event_attr 17 *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused) 18 { 19 #ifdef HAVE_AUXTRACE_SUPPORT 20 if (!strcmp(pmu->name, CORESIGHT_ETM_PMU_NAME)) { 21 /* add ETM default config here */ 22 pmu->selectable = true; 23 #if defined(__aarch64__) 24 } else if (strstarts(pmu->name, ARM_SPE_PMU_NAME)) { 25 return arm_spe_pmu_default_config(pmu); 26 } else if (strstarts(pmu->name, HISI_PTT_PMU_NAME)) { 27 pmu->selectable = true; 28 #endif 29 } 30 31 #endif 32 return NULL; 33 } 34