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 scheduler statistics #6939

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

derekbruening
Copy link
Contributor

@derekbruening derekbruening commented Aug 27, 2024

Adds schedule statistics to memtrace_stream.h. Implements these statistics in the streams returned by scheduler_t. This initial round includes the following values:

[scheduler] Stats for output #0
[scheduler]   Switch input->input      :        16
[scheduler]   Switch input->idle       :         4
[scheduler]   Switch idle->input       :         3
[scheduler]   Switch nop               :       119
[scheduler]   Quantum preempts         :       131
[scheduler]   Direct switch attempts   :         0
[scheduler]   Direct switch successes  :         0

The switches are split into those 4 categories to make it easier to compare to other sources of switch counts, such as perf where perf limited to a cgroup or process will be missing the idle->input switches, or schedule_stats which is missing the input->idle today.

Adds checks that these match the schedule_stats tool's values.

Adds tests of the values to several key scheduler unit tests.

Issue: #6938

Adds schedule statistics to memtrace_stream.h.  Implements these
statistics in the streams returned by scheduler_t.  This initial round
includes total switches, time preempts, and direct switch attempts and
successes.

Adds checks that these match the schedule_stats tool's values.

Adds tests of the values to several key scheduler unit tests.

Issue: #6938
@derekbruening
Copy link
Contributor Author

a64-sve failure is the very flaky #3320

Copy link
Contributor

@brettcoon brettcoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple suggestions.

clients/drcachesim/common/memtrace_stream.h Outdated Show resolved Hide resolved
clients/drcachesim/scheduler/scheduler.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/scheduler_unit_tests.cpp Outdated Show resolved Hide resolved
@derekbruening
Copy link
Contributor Author

I also split the switches into 4 categories. Maybe there are enough changes to warrant another review.

Here is an example output now:

$ bin64/drrun -t drmemtrace -indir drmemtrace.threadsig.5* -tool schedule_stats -core_sharded -cores 3 -verbose 1 -sched_quantum 50000
Core #0 schedule: AaaaCBCBCccDEeeDCDCEBDCE_B_C_C_
Core #1 schedule: BE_CDCDECBECBDEDBCDBEBDddBbbbbDECBbA_E__
Core #2 schedule: CD_DBEDEDBDCDECBEBECEeeBEDECDCDCDCDCDCDCDCDCDCEDCDCDCDCDCBECEDd_C_D_D_C_C_C
[scheduler] Stats for output #0
[scheduler]   Switch input->input      :        16
[scheduler]   Switch input->idle       :         4
[scheduler]   Switch idle->input       :         3
[scheduler]   Switch nop               :       119
[scheduler]   Quantum preempts         :       131
[scheduler]   Direct switch attempts   :         0
[scheduler]   Direct switch successes  :         0
[scheduler] Stats for output #1
[scheduler]   Switch input->input      :        26
[scheduler]   Switch input->idle       :         3
[scheduler]   Switch idle->input       :         2
[scheduler]   Switch nop               :       106
[scheduler]   Quantum preempts         :       129
[scheduler]   Direct switch attempts   :         0
[scheduler]   Direct switch successes  :         0
[scheduler] Stats for output #2
[scheduler]   Switch input->input      :        57
[scheduler]   Switch input->idle       :         7
[scheduler]   Switch idle->input       :         7
[scheduler]   Switch nop               :        86
[scheduler]   Quantum preempts         :       135
[scheduler]   Direct switch attempts   :         0
[scheduler]   Direct switch successes  :         0

@derekbruening derekbruening merged commit 8db35ac into master Aug 28, 2024
17 checks passed
@derekbruening derekbruening deleted the i6938-scheduler-stats branch August 28, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants