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#5694: Add core-oriented analysis tool support #6279

Merged
merged 6 commits into from
Aug 31, 2023

Conversation

derekbruening
Copy link
Contributor

Adds a new type of sharding for drmemtrace analysis tools: by core instead of by thread.

Introduces a shard_type_t enum (SHARD_BY_THREAD and SHARD_BY_CORE) passed to a new analysis_tool_t::initialize_shard_type() function to inform tools of the shard type (this cannot be easily added to the stream interface as the scheduler is not aware of the shard type).

Adds a new memtrace_stream_t::get_output_cpuid() query to get the output cpu ordinal, or for replaying as-traced the original traced cpuid (#6262). Implements this for the scheduler. This addresses #6262.

Generalizes analyzer_t to take in scheduler options for SHARD_BY_CORE to support analysis tools using the full range of schedules. In this mode, the core count is the worker count. Updates the shard index to be the core ordinal. Adds time-based scheduling support with analyzer_t using wall-clock time as the current time.

Adds a number of options to set sharding mode (-core_sharding, -core_serial (not yet implemented)) and control the schedule (-sched_quantum, -sched_time, sched_order_time, -record_file, -replay_file, -cpu_schedule_file).

Updates the basic_counts tool to support core sharding.

Adds a new test core_sharded_test which leverages the analyzer_multi and option parsing to test the top-level options within a framework that can capture the output and run multiple tests sequentially in a simpler framework than having a separate test with an output file for each parameter being tested.

Left as future work:

  • Convert scheduler_launcher into a new schedule_stats tool
  • Add a new record to indicate STATUS_WAIT
  • Add -core_serial support
  • Convert drcachesim default and -cpu_scheduling to use get_output_cpuid()

Issue: #5694, #6262
Fixes #6262

Adds a new type of sharding for drmemtrace analysis tools: by core
instead of by thread.

Introduces a shard_type_t enum (SHARD_BY_THREAD and SHARD_BY_CORE)
passed to a new analysis_tool_t::initialize_shard_type() function to
inform tools of the shard type (this cannot be easily added to the
stream interface as the scheduler is not aware of the shard type).

Adds a new memtrace_stream_t::get_output_cpuid() query to get the
output cpu ordinal, or for replaying as-traced the original traced
cpuid (#6262).  Implements this for the scheduler.

Generalizes analyzer_t to take in scheduler options for SHARD_BY_CORE
to support analysis tools using the full range of schedules.  In this
mode, the core count is the worker count.  Updates the shard index to
be the core ordinal.  Adds time-based scheduling support with
analyzer_t using wall-clock time as the current time.

Adds a number of options to set sharding mode (-core_sharding,
-core_serial (not yet implemented)) and control the schedule
(-sched_quantum, -sched_time, sched_order_time, -record_file,
-replay_file, -cpu_schedule_file).

Updates the basic_counts tool to support core sharding.

Adds a new test core_sharded_test which leverages the analyzer_multi
and option parsing to test the top-level options within a framework
that can capture the output and run multiple tests sequentially in a
simpler framework than having a separate test with an output file for
each parameter being tested.

Left as future work:
+ Convert scheduler_launcher into a new schedule_stats tool
+ Add a new record to indicate STATUS_WAIT
+ Add -core_serial support
+ Convert drcachesim default and -cpu_scheduling to use
  get_output_cpuid()

Issue: #5694
@derekbruening
Copy link
Contributor Author

ubuntu22 failure is api.rseq #6185

Copy link
Contributor

@abhinav92003 abhinav92003 left a comment

Choose a reason for hiding this comment

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

I had some questions to help me understand better what we need to support here. Will do another round of review after.

clients/drcachesim/analysis_tool.h Show resolved Hide resolved
clients/drcachesim/analysis_tool.h Show resolved Hide resolved
clients/drcachesim/analyzer.cpp Show resolved Hide resolved
clients/drcachesim/analyzer.cpp Outdated Show resolved Hide resolved
clients/drcachesim/analyzer.h Show resolved Hide resolved
clients/drcachesim/analyzer_multi.cpp Show resolved Hide resolved
clients/drcachesim/common/options.cpp Outdated Show resolved Hide resolved
clients/drcachesim/common/options.cpp Show resolved Hide resolved
clients/drcachesim/common/options.cpp Show resolved Hide resolved
@derekbruening
Copy link
Contributor Author

(32-bit failures are known flakes: scatter-gather and client_detach)

@abhinav92003
Copy link
Contributor

I had some questions to help me understand better what we need to support here. Will do another round of review after.

Thanks for the explanations. I replied on existing comment threads and left some new ones. LGTM.

@derekbruening derekbruening merged commit b90efa9 into master Aug 31, 2023
15 checks passed
@derekbruening derekbruening deleted the i5694-core-oriented branch August 31, 2023 01:59
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.

Provide a way to query cpu id for scheduler output streams
2 participants