2 * Copyright(C) 2015 Linaro Limited. All rights reserved.
3 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
19 #include <linux/coresight-pmu.h>
21 #include "../../util/auxtrace.h"
22 #include "../../util/evlist.h"
23 #include "../../util/pmu.h"
26 struct auxtrace_record
27 *auxtrace_record__init(struct perf_evlist *evlist, int *err)
29 struct perf_pmu *cs_etm_pmu;
30 struct perf_evsel *evsel;
31 bool found_etm = false;
33 cs_etm_pmu = perf_pmu__find(CORESIGHT_ETM_PMU_NAME);
36 evlist__for_each_entry(evlist, evsel) {
38 evsel->attr.type == cs_etm_pmu->type)
44 return cs_etm_record_init(err);
47 * Clear 'err' even if we haven't found a cs_etm event - that way perf
48 * record can still be used even if tracers aren't present. The NULL
49 * return value will take care of telling the infrastructure HW tracing