aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/arch/arm64
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2020-02-17 10:23:00 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-02-18 10:13:29 -0300
commitad60ba0c2e6da6ff573c5ac57708fbc443bbb473 (patch)
tree91777e827d27ef036b1d9dc50cd1ad66970e846f /tools/perf/arch/arm64
parentperf arm-spe: Fix endless record after being terminated (diff)
downloadlinux-dev-ad60ba0c2e6da6ff573c5ac57708fbc443bbb473.tar.xz
linux-dev-ad60ba0c2e6da6ff573c5ac57708fbc443bbb473.zip
perf auxtrace: Add auxtrace_record__read_finish()
All ->read_finish() implementations are doing the same thing. Add a helper function so that they can share the same implementation. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Leo Yan <leo.yan@linaro.org> Tested-by: Leo Yan <leo.yan@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kim Phillips <kim.phillips@arm.com> Cc: Wei Li <liwei391@huawei.com> Link: http://lore.kernel.org/lkml/20200217082300.6301-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/arch/arm64')
-rw-r--r--tools/perf/arch/arm64/util/arm-spe.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
index 1d993c27242b..8d6821d9c3f6 100644
--- a/tools/perf/arch/arm64/util/arm-spe.c
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -158,23 +158,6 @@ static void arm_spe_recording_free(struct auxtrace_record *itr)
free(sper);
}
-static int arm_spe_read_finish(struct auxtrace_record *itr, int idx)
-{
- struct arm_spe_recording *sper =
- container_of(itr, struct arm_spe_recording, itr);
- struct evsel *evsel;
-
- evlist__for_each_entry(sper->evlist, evsel) {
- if (evsel->core.attr.type == sper->arm_spe_pmu->type) {
- if (evsel->disabled)
- return 0;
- return perf_evlist__enable_event_idx(sper->evlist,
- evsel, idx);
- }
- }
- return -EINVAL;
-}
-
struct auxtrace_record *arm_spe_recording_init(int *err,
struct perf_pmu *arm_spe_pmu)
{
@@ -192,12 +175,13 @@ struct auxtrace_record *arm_spe_recording_init(int *err,
}
sper->arm_spe_pmu = arm_spe_pmu;
+ sper->itr.pmu = arm_spe_pmu;
sper->itr.recording_options = arm_spe_recording_options;
sper->itr.info_priv_size = arm_spe_info_priv_size;
sper->itr.info_fill = arm_spe_info_fill;
sper->itr.free = arm_spe_recording_free;
sper->itr.reference = arm_spe_reference;
- sper->itr.read_finish = arm_spe_read_finish;
+ sper->itr.read_finish = auxtrace_record__read_finish;
sper->itr.alignment = 0;
*err = 0;