diff options
author | Michael O'Farrell <micpof@gmail.com> | 2024-10-22 16:01:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-22 16:01:13 -0700 |
commit | b4fcaa137f057e68a9011b26c11627a16a8c9374 (patch) | |
tree | 24ca0aac43253946528d2ca14a545382c776995d /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 2e0506f83bfde6db93454bdf28e4a71c160d4f5b (diff) | |
download | llvm-b4fcaa137f057e68a9011b26c11627a16a8c9374.zip llvm-b4fcaa137f057e68a9011b26c11627a16a8c9374.tar.gz llvm-b4fcaa137f057e68a9011b26c11627a16a8c9374.tar.bz2 |
[PGO][SampledInstr] Correct off by 1s and allow 100% sampling (#113350)
This corrects a couple off by ones related to the sampling of
**instrumented** counters, and enables setting 100% rates for burst
sampling (burst duration = period).
Off by ones:
Prior to this change it was impossible to set a period of 65535 because
this was converted to fast sampling which rollsover at USHRT_MAX + 1
(65536). Similarly the burst durations would collect burst duration + 1
counts as they used an ULE comparison.
100% sampling:
Although this is not useful for a productionized use case, it does allow
for more deterministic testing with the sampling checks in place. After
all the off by ones are fixed, allowing for 100% sampling is a matter of
letting burst duration = period.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions