17e21b0d5SMathieu Poirier /* 27e21b0d5SMathieu Poirier * Copyright(C) 2015 Linaro Limited. All rights reserved. 37e21b0d5SMathieu Poirier * Author: Mathieu Poirier <mathieu.poirier@linaro.org> 47e21b0d5SMathieu Poirier * 57e21b0d5SMathieu Poirier * This program is free software; you can redistribute it and/or modify it 67e21b0d5SMathieu Poirier * under the terms of the GNU General Public License version 2 as published by 77e21b0d5SMathieu Poirier * the Free Software Foundation. 87e21b0d5SMathieu Poirier * 97e21b0d5SMathieu Poirier * This program is distributed in the hope that it will be useful, but WITHOUT 107e21b0d5SMathieu Poirier * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 117e21b0d5SMathieu Poirier * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 127e21b0d5SMathieu Poirier * more details. 137e21b0d5SMathieu Poirier * 147e21b0d5SMathieu Poirier * You should have received a copy of the GNU General Public License along with 157e21b0d5SMathieu Poirier * this program. If not, see <http://www.gnu.org/licenses/>. 167e21b0d5SMathieu Poirier */ 177e21b0d5SMathieu Poirier 187e21b0d5SMathieu Poirier #include <string.h> 197e21b0d5SMathieu Poirier #include <linux/coresight-pmu.h> 207e21b0d5SMathieu Poirier #include <linux/perf_event.h> 217e21b0d5SMathieu Poirier 223becf452SMathieu Poirier #include "cs-etm.h" 23ffd3d18cSKim Phillips #include "arm-spe.h" 247e21b0d5SMathieu Poirier #include "../../util/pmu.h" 257e21b0d5SMathieu Poirier 267e21b0d5SMathieu Poirier struct perf_event_attr 277e21b0d5SMathieu Poirier *perf_pmu__get_default_config(struct perf_pmu *pmu __maybe_unused) 287e21b0d5SMathieu Poirier { 297e21b0d5SMathieu Poirier #ifdef HAVE_AUXTRACE_SUPPORT 307e21b0d5SMathieu Poirier if (!strcmp(pmu->name, CORESIGHT_ETM_PMU_NAME)) { 317e21b0d5SMathieu Poirier /* add ETM default config here */ 327e21b0d5SMathieu Poirier pmu->selectable = true; 333becf452SMathieu Poirier pmu->set_drv_config = cs_etm_set_drv_config; 34ffd3d18cSKim Phillips #if defined(__aarch64__) 35ffd3d18cSKim Phillips } else if (strstarts(pmu->name, ARM_SPE_PMU_NAME)) { 36ffd3d18cSKim Phillips return arm_spe_pmu_default_config(pmu); 37ffd3d18cSKim Phillips #endif 387e21b0d5SMathieu Poirier } 39ffd3d18cSKim Phillips 407e21b0d5SMathieu Poirier #endif 417e21b0d5SMathieu Poirier return NULL; 427e21b0d5SMathieu Poirier } 43