drivers: soc: qcom: read current counter value before PMU save

Call perf_event_read_local() to update current counter value
in hw_perf_event structure before saving PMU snapshot to
shared memory.

Change-Id: Id5945cd6b6c9fab6f87917224b5b5f54dca5ef9c
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
This commit is contained in:
Santosh Mardi 2020-11-02 12:27:35 +05:30
commit 73ee91fc44

View file

@ -632,6 +632,8 @@ static void save_cpugrp_pmu_events(struct memlat_cpu_grp *cpu_grp, u8 cpu)
!cpus_data->common_evs[i])
continue;
perf_event_read_local(cpus_data->common_evs[i],
&ev_count, NULL, NULL);
ev_count = local64_read(&cpus_data->common_evs[i]->hw.prev_count);
store_event_val(ev_count, hw_id, cpu);
}
@ -651,6 +653,9 @@ static void save_mon_pmu_events(struct memlat_mon *mon, u8 cpu)
if (hw_id == INVALID_PMU_HW_IDX ||
!ev_data->mon_evs[i])
continue;
perf_event_read_local(ev_data->mon_evs[i],
&ev_count, NULL, NULL);
ev_count = local64_read(&ev_data->mon_evs[i]->hw.prev_count);
store_event_val(ev_count, hw_id, cpu);
}