-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i#5694 core-sharded: Add get_shard_index() + get_tid() (#6568)
Adds 2 new memtrace_stream_t interfaces to simplify generalizing tools to handle either thread or core sharded operation: + get_shard_index() returns a 0-based shard ordinal regardless of whether core-sharded or thread-sharded. + get_tid() returns the thread id of the current input. This is a convenience method for use in parallel_shard_init_stream() prior to access to any memref_t records. For online analysis where there's a single input, the scheduler remembers and returns the last memref.data.tid for get_tid() and uses the dynamic tid discovery order for get_shard_index(). Changes an existing interface: + Guarantees that the shard_index passed to parallel_shard_init_stream() is a 0-based ordinal. Implements the 2 new interfaces in the scheduler and adds two new interface there: + get_output_stream_ordinal() to get the underlying output when using single_lockstep_output. + get_output_cpuid(ord) taking in an ordinal so the analyzer or other user can get the cpuids statically when using single_lockstep_output. Analysis tools must dynamically discover the cpuids (stopped short of making this a memtrace_stream_t interface, as analysis tools in general must dynamically discover most things already). Removes dr$sim's manual mapping of cpuid to core index in favor of using the new get_shard_index(). Updates all the analysis tools to use the new interfaces and to generalize their code to either handle both thread and core shards (reuse_time, reuse_distance, basic_counts, histogram, opcode_mix, syscall_mix, record_filter) or explicitly return an error for core-sharded modes (func_view, invariant_checker). (schedule_stats and record_filter needed no changes.) Updates several unit tests to handle these changes: + Expands the default_memtrace_stream_t to be suitable as a mock stream for unit tests with the new interfaces. + Skips invariant stream checks for the mock stream by checking its input interface, since the stream itself is no longer null. + Fixes drcachesim unit tests which were not initializing tid. Adds some sanity tests on the new interfaces. Adds a new end-to-end test running the newly-updated tools as -core_sharded. Limits the reuse_time histogram printing output to avoid hanging CMake's regex matcher in this test. Issue: #5694
- Loading branch information
1 parent
e982665
commit 910f82d
Showing
30 changed files
with
560 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.