Skip to content

Commit

Permalink
i#6938 migrate: Include sched stats in query and fix related assert (#…
Browse files Browse the repository at this point in the history
…7060)

schedule_stats_t::get_total_counts() was not including
scheduler-provided stats, as it was doing its own simple aggregation
instead of calling aggregate_results(). We fix that here. That then
triggers the newly added assert from PR #7057 which checks for the
scheduler-provided value being exactly equal meaning there is no data
available. It fires on the schedule_stats_test, which uses a mock stream
which returns -1 for such a stat, so we end up with a negative value. We
update the assert for that condition.

Issue: #6938
  • Loading branch information
derekbruening authored Oct 29, 2024
1 parent 8f975be commit b88a389
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions clients/drcachesim/tools/schedule_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ schedule_stats_t::aggregate_results(counters_t &total)
// Our observed_migrations are counted on the destination core, while
// the scheduler reports migrations away from a source core: so we only
// check the aggregate. For non-dynamic schedules the scheduler-reported
// will be 0; otherwise, the scheduler may see more migrations due to inputs
// not yet executed moving among runqueues.
assert(total.migrations == 0. || total.migrations >= total.observed_migrations);
// will be 0; for mock streams in tests it will be < 0; otherwise, the scheduler
// may see more migrations due to inputs not yet executed moving among runqueues.
assert(total.migrations <= 0. || total.migrations >= total.observed_migrations);
}

bool
Expand All @@ -531,9 +531,7 @@ schedule_stats_t::counters_t
schedule_stats_t::get_total_counts()
{
counters_t total;
for (const auto &shard : shard_map_) {
total += shard.second->counters;
}
aggregate_results(total);
return total;
}

Expand Down

0 comments on commit b88a389

Please sign in to comment.