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

Skip to content
Commit d729bcf0 authored by Neil Leeder's avatar Neil Leeder
Browse files

Perf: reset pmu enables when starting perf



PMU enable registers are not cleared when coming out
of cpu idle and perf is not running. This means that
enable bits may be set when perf starts. This is not normally
a problem because perf only looks at the counters it enables.
But per-pid tracing will see the enabled counters and the
garbage count values that get put into trace records, and generally
be unable to distinguish them from good values.

Clear the counters when perf starts. Then also reset them when coming
out of cpu idle. The existing test was to do this when a perf
event was running on a cpu, but there is a window between init and
starting events where drop into cpu idle could happen and allow garbage
values to be loaded into the enable register again. So change the
criterion for reset after cpu idle to be whenever the PMU is running.

Change-Id: Ie807363de92d166994ebbb9369132176ceaa4f68
Signed-off-by: default avatarNeil Leeder <nleeder@codeaurora.org>
parent ab01e731
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment