summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
author Connor O'Brien <connoro@google.com> 2019-07-24 15:42:11 -0700
committer Connor O'Brien <connoro@google.com> 2019-07-29 12:13:01 -0700
commit6c501ea04e486d9bf5c8a08d0d63dadcd9be83a9 (patch)
treeb5859dccfbdc45ddeb3882f6b6e54ce706f1f28d /vulkan/libvulkan/api.cpp
parentc6b39156522bad9e546b91c047677b6ac077657e (diff)
libtimeinstate: fix bug in clearUidCpuFreqTimes
In a preallocated bpf hash table, deleting a map element makes it available for reuse without clearing the data it holds. This reuse can occur when a bpf program calls bpf_map_update_elem with a key not already present in the map. If the map is percpu, bpf_map_update_elem will overwrite the reused entry's data for the current CPU but not for other CPUs, resulting in stale data that is now associated with the wrong key. For time in state, this can show up as impossible data (e.g. reporting that a UID ran on one cluster at a frequency only available on a different cluster), which is detected by the SingleAndAllUidConsistent test since getUidCpuFreqTimes() only looks up potentially valid keys while getUidsCpuFreqTimes() iterates through every map entry. Avoid this problem by zeroing out each entry's data prior to deleting it from the map. Also modify getUidCpuFreqTimes and getUidsCpuFreqTimes to check for impossible data and fail if any is detected, since it's a sign that other map entries may also be wrong. Bug: 138317993 Test: libtimeinstate_test can now be run repeatedly without SingleAndAllUidConsistent test eventually failing Signed-off-by: Connor O'Brien <connoro@google.com> Change-Id: I17dd407f897d1e86eb85cc99842a581d88e5bc78
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
0 files changed, 0 insertions, 0 deletions