Skip to content

Commit

Permalink
Fix behavior in case EmitLoggingArraySampleRate=1
Browse files Browse the repository at this point in the history
Summary: The modulo test below fails when we set the sample rate = 1. Fix it.

Differential Revision: D30542973

fbshipit-source-id: 23c8fdd415b189bdeb1be21b54ec2a7812a56183
  • Loading branch information
colavitam authored and facebook-github-bot committed Aug 26, 2021
1 parent 7c29f39 commit 0377505
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hphp/runtime/base/bespoke/logging-array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ ArrayData* maybeMakeLoggingArray(ArrayData* ad, LoggingProfile* profile) {
auto const shouldEmitBespoke = [&]{
if (shouldTestBespokeArrayLikes()) return true;
if (RO::EvalEmitLoggingArraySampleRate == 0) return false;
if (RO::EvalEmitLoggingArraySampleRate == 1) return true;

// We want the first sample to be vanilla and the second to be logged.
auto const skCount = profile->data->sampleCount++;
Expand Down

0 comments on commit 0377505

Please sign in to comment.