Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DynamoRIO/dynamorio into i6938-ob…
Browse files Browse the repository at this point in the history
…served-migrations
  • Loading branch information
derekbruening committed Oct 28, 2024
2 parents f65bf59 + d70ab44 commit 466635b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
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 @@ -430,6 +434,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 @@ -148,6 +148,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 Down Expand Up @@ -175,6 +177,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

0 comments on commit 466635b

Please sign in to comment.