Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#6938 sched migrate: Add steals + rebalances to schedule stats #7056

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/core_serial.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Total counts:
0 switches nop-ed
0 quantum_preempts
0 migrations
0 work steals
0 rebalances
161 system calls
2 maybe-blocking system calls
0 direct switch requests
Expand Down
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/schedule_stats_nopreempt.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Total counts:
0 switches nop-ed
0 quantum_preempts
0 migrations
0 work steals
1 rebalances
161 system calls
2 maybe-blocking system calls
0 direct switch requests
Expand Down
6 changes: 6 additions & 0 deletions clients/drcachesim/tools/schedule_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ schedule_stats_t::get_scheduler_stats(memtrace_stream_t *stream, counters_t &cou
stream->get_schedule_statistic(memtrace_stream_t::SCHED_STAT_QUANTUM_PREEMPTS));
counters.migrations = static_cast<int64_t>(
stream->get_schedule_statistic(memtrace_stream_t::SCHED_STAT_MIGRATIONS));
counters.steals = static_cast<int64_t>(
stream->get_schedule_statistic(memtrace_stream_t::SCHED_STAT_RUNQUEUE_STEALS));
counters.rebalances = static_cast<int64_t>(stream->get_schedule_statistic(
memtrace_stream_t::SCHED_STAT_RUNQUEUE_REBALANCES));

// XXX: Currently, schedule_stats is measuring swap-ins to a real input. If we
// want to match what "perf" targeting this app would record, which is swap-outs,
Expand Down Expand Up @@ -417,6 +421,8 @@ schedule_stats_t::print_counters(const counters_t &counters)
std::cerr << std::setw(12) << counters.switches_nop << " switches nop-ed\n";
std::cerr << std::setw(12) << counters.quantum_preempts << " quantum_preempts\n";
std::cerr << std::setw(12) << counters.migrations << " migrations\n";
std::cerr << std::setw(12) << counters.steals << " work steals\n";
std::cerr << std::setw(12) << counters.rebalances << " rebalances\n";

std::cerr << std::setw(12) << counters.syscalls << " system calls\n";
std::cerr << std::setw(12) << counters.maybe_blocking_syscalls
Expand Down
4 changes: 4 additions & 0 deletions clients/drcachesim/tools/schedule_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ class schedule_stats_t : public analysis_tool_t {
switches_nop += rhs.switches_nop;
quantum_preempts += rhs.quantum_preempts;
migrations += rhs.migrations;
steals += rhs.steals;
rebalances += rhs.rebalances;
instrs += rhs.instrs;
total_switches += rhs.total_switches;
voluntary_switches += rhs.voluntary_switches;
Expand All @@ -173,6 +175,8 @@ class schedule_stats_t : public analysis_tool_t {
int64_t switches_nop = 0;
int64_t quantum_preempts = 0;
int64_t migrations = 0;
int64_t steals = 0;
int64_t rebalances = 0;
// Our own statistics.
int64_t instrs = 0;
int64_t total_switches = 0;
Expand Down
Loading