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

Add per-sysnum latency and switch stats to the drmemtrace schedule_stats tool #7355

Closed
derekbruening opened this issue Mar 13, 2025 · 1 comment · Fixed by #7391
Closed

Comments

@derekbruening
Copy link
Contributor

The drmemtrace scheduler uses system call latency data to decide whether to switch. Having details on per-syscall-number latency and switch count would help analyze whether it's doing the right thing compared to the original workload. We can add this to the schedule_stats tool.

@derekbruening derekbruening self-assigned this Mar 13, 2025
derekbruening added a commit that referenced this issue Mar 17, 2025
Updates the checked-in traces in
clients/drcachesim/tests/drmemtrace.threadsig.x86.tracedir/ with new
version with features missing from the old ones such as timestamps
around each syscall. These features are needed for scheduler features.

Updates various tests with "golden output" tuned to the old
traces. Tries to reduce the amount of such output to make it a little
easier to update next time.

The new traces have more interleaving and longer wait times,
necessitating some tweaks to tests that use the full scheduler to
avoid them becoming too long or verbose.

Issue: #7355
derekbruening added a commit that referenced this issue Mar 18, 2025
…7365)

Updates the checked-in traces in
clients/drcachesim/tests/drmemtrace.threadsig.x86.tracedir/ with new
version with features missing from the old ones such as timestamps
around each syscall. These features are needed for scheduler features.

Updates various tests with "golden output" tuned to the old traces.
Tries to reduce the amount of such output to make it a little easier to
update next time.

The new traces have more interleaving and longer wait times,
necessitating some tweaks to tests that use the full scheduler to avoid
them becoming too long or verbose.

Issue: #7355
derekbruening added a commit that referenced this issue Mar 18, 2025
…x64.tracedir

Updates the trace in
tests/drmemtrace.threadsig-core-sharded.x64.tracedir so that it has
the TRACE_ENTRY_VERSION_FREQUENT_TIMESTAMPS feature, needed for the
new per-syscall latency feature in schedule_stats.

Issue: #7355
@derekbruening
Copy link
Contributor Author

This turns out to be impossible for core-sharded-on-disk traces as the scheduler has replaced the timestamps with values based on instruction and idle counts to this point. Since it processes the post-syscall record before switching, there have been no idles: so every syscall seemingly has latency 0. I'm probably just going to live with that as it would be complex to shift where the post-syscall timestamp appears; and if it were delayed, it gets hard to implement latency tracking in schedule_stats as it would need to track across threads which could move across cores and might require global locks.

derekbruening added a commit that referenced this issue Mar 19, 2025
…ta (#7372)

Updates the trace in
tests/drmemtrace.threadsig-core-sharded.x64.tracedir so that it has the
TRACE_ENTRY_VERSION_FREQUENT_TIMESTAMPS feature, needed for the new
per-syscall latency feature in schedule_stats.

Issue: #7355
derekbruening added a commit that referenced this issue Mar 20, 2025
…istograms

Augments the schedule_stats drmemtrace tool to keep two histograms for
each system call number: one for latencies of system calls causing a
context switch, and one for latencies not switching.  Unfortunately
the latencies are all 0 for core-sharded-on-disk traces; we live with
that for now.

Generalizes the histogram support through virtual methods
create_histogram() and find_or_add_histogram() to make it easier to
use different histograms in subclasses with all the new histograms
being added here.

Adds a unit test and augments top-level test expected output.

Fixes #7355
derekbruening added a commit that referenced this issue Mar 24, 2025
Fixes 3 clang-tidy warnings:
+ Removes default parameter value on virtual function
  schedule_stats_t::create_histogram()
+ Fixes inconsistent parameter name in is_annotation_tag()
+ Adds missing annotations_api.h header

Issue: #4103, #7355
derekbruening added a commit that referenced this issue Mar 24, 2025
Fixes 3 clang-tidy warnings:
+ Removes default parameter value on virtual function
schedule_stats_t::create_histogram()
+ Fixes inconsistent parameter name in is_annotation_tag()
+ Adds missing annotations_api.h header

Issue: #4103, #7355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant