Skip to content

Commit

Permalink
Relax the overflow DCHECK in perf_profile_connector.cc. (#1779)
Browse files Browse the repository at this point in the history
Summary: during `pem` startup, the transfer data method for various
source connectors can get starved i.e. not called at the correct
periodicity. This will cause the overflow `DCHECK` in the perf profiler
to fire. In this PR, we relax that condition.

Relevant Issues: #1683

Type of change: /kind bug fix

Test Plan: Existing tests.

---------

Signed-off-by: Pete Stevenson <[email protected]>
  • Loading branch information
Pete Stevenson authored Jan 11, 2024
1 parent 2e26307 commit ccf0a9b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,12 @@ void PerfProfileConnector::CheckProfilerState(const uint64_t num_stack_traces) {
const uint64_t error_code =
profiler_state_->GetValue(kErrorStatusIdx).ValueOr(kPerfProfilerStatusOk);

DCHECK_EQ(error_code, kPerfProfilerStatusOk);
// Set max overflow count non-zero because, during pem startup, the profiler transfer data
// method can get starved; i.e. we do expect a few overflow count errors during bringup.
constexpr int64_t max_overflow_error_count = 10;
constexpr int64_t max_map_read_error_count = 0;
DCHECK_LE(profiler_state_overflow_counter_.Value(), max_overflow_error_count);
DCHECK_LE(profiler_state_map_read_error_counter_.Value(), max_map_read_error_count);

switch (error_code) {
case kOverflowError: {
Expand Down

0 comments on commit ccf0a9b

Please sign in to comment.