Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73ee91fc authored by Santosh Mardi's avatar Santosh Mardi
Browse files

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: default avatarSantosh Mardi <gsantosh@codeaurora.org>
parent 8c86f959
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
	}