.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * auxtrace.c: AUX area tracing support |
---|
3 | 4 | * Copyright (c) 2013-2014, Intel Corporation. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms and conditions of the GNU General Public License, |
---|
7 | | - * version 2, as published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope 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 |
---|
12 | | - * more details. |
---|
13 | | - * |
---|
14 | 5 | */ |
---|
15 | 6 | |
---|
16 | 7 | #include <errno.h> |
---|
17 | 8 | #include <stdbool.h> |
---|
18 | 9 | |
---|
19 | | -#include "../../util/header.h" |
---|
20 | | -#include "../../util/debug.h" |
---|
21 | | -#include "../../util/pmu.h" |
---|
22 | | -#include "../../util/auxtrace.h" |
---|
23 | | -#include "../../util/intel-pt.h" |
---|
24 | | -#include "../../util/intel-bts.h" |
---|
25 | | -#include "../../util/evlist.h" |
---|
| 10 | +#include "../../../util/header.h" |
---|
| 11 | +#include "../../../util/debug.h" |
---|
| 12 | +#include "../../../util/pmu.h" |
---|
| 13 | +#include "../../../util/auxtrace.h" |
---|
| 14 | +#include "../../../util/intel-pt.h" |
---|
| 15 | +#include "../../../util/intel-bts.h" |
---|
| 16 | +#include "../../../util/evlist.h" |
---|
26 | 17 | |
---|
27 | 18 | static |
---|
28 | | -struct auxtrace_record *auxtrace_record__init_intel(struct perf_evlist *evlist, |
---|
| 19 | +struct auxtrace_record *auxtrace_record__init_intel(struct evlist *evlist, |
---|
29 | 20 | int *err) |
---|
30 | 21 | { |
---|
31 | 22 | struct perf_pmu *intel_pt_pmu; |
---|
32 | 23 | struct perf_pmu *intel_bts_pmu; |
---|
33 | | - struct perf_evsel *evsel; |
---|
| 24 | + struct evsel *evsel; |
---|
34 | 25 | bool found_pt = false; |
---|
35 | 26 | bool found_bts = false; |
---|
36 | 27 | |
---|
37 | 28 | intel_pt_pmu = perf_pmu__find(INTEL_PT_PMU_NAME); |
---|
| 29 | + if (intel_pt_pmu) |
---|
| 30 | + intel_pt_pmu->auxtrace = true; |
---|
38 | 31 | intel_bts_pmu = perf_pmu__find(INTEL_BTS_PMU_NAME); |
---|
| 32 | + if (intel_bts_pmu) |
---|
| 33 | + intel_bts_pmu->auxtrace = true; |
---|
39 | 34 | |
---|
40 | 35 | evlist__for_each_entry(evlist, evsel) { |
---|
41 | | - if (intel_pt_pmu && evsel->attr.type == intel_pt_pmu->type) |
---|
| 36 | + if (intel_pt_pmu && evsel->core.attr.type == intel_pt_pmu->type) |
---|
42 | 37 | found_pt = true; |
---|
43 | | - if (intel_bts_pmu && evsel->attr.type == intel_bts_pmu->type) |
---|
| 38 | + if (intel_bts_pmu && evsel->core.attr.type == intel_bts_pmu->type) |
---|
44 | 39 | found_bts = true; |
---|
45 | 40 | } |
---|
46 | 41 | |
---|
.. | .. |
---|
59 | 54 | return NULL; |
---|
60 | 55 | } |
---|
61 | 56 | |
---|
62 | | -struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist, |
---|
| 57 | +struct auxtrace_record *auxtrace_record__init(struct evlist *evlist, |
---|
63 | 58 | int *err) |
---|
64 | 59 | { |
---|
65 | 60 | char buffer[64]; |
---|