Skip to content

Commit

Permalink
i#6734: Set filetype in record_filter start-idle shards (#6735)
Browse files Browse the repository at this point in the history
Sets the filetype for record_filter shards from the filetype_ var to
ensure start-idle shards have the correct type.

Switches to using opcode_mix in the tool.record_filter_bycore_uni test,
which fails with encoding errors without this fix.

Fixes #6734
  • Loading branch information
derekbruening authored Mar 27, 2024
1 parent d20abf4 commit 8e23247
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 1 addition & 5 deletions clients/drcachesim/tests/record_filter_bycore_uni.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ Hello, world!
#endif
Trace invariant checks passed
Output .* entries from .* entries.
Schedule stats tool results:
Opcode mix tool results:
.*
Core #0 schedule: .*
Core #1 schedule: .*
Core #2 schedule: .*
Core #3 schedule: .*
3 changes: 3 additions & 0 deletions clients/drcachesim/tools/filter/record_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ record_filter_t::initialize_shard_output(per_shard_t *per_shard,
shard_stream->get_shard_index(), output_ext_.c_str(), version_,
filetype_);
per_shard->output_path += output_ext_;
per_shard->filetype = static_cast<addr_t>(filetype_);
lock.unlock();
} else if (!input_name.empty()) {
size_t last_dot = input_name.rfind('.');
Expand All @@ -232,6 +233,7 @@ record_filter_t::initialize_shard_output(per_shard_t *per_shard,
shard_stream->get_shard_index(), output_ext_.c_str(), version_,
filetype_);
per_shard->output_path += output_ext_;
per_shard->filetype = static_cast<addr_t>(filetype_);
lock.unlock();
input_info_cond_var_.notify_all();
} else {
Expand All @@ -242,6 +244,7 @@ record_filter_t::initialize_shard_output(per_shard_t *per_shard,
shard_stream->get_shard_index(), output_ext_.c_str(), version_,
filetype_);
per_shard->output_path += output_ext_;
per_shard->filetype = static_cast<addr_t>(filetype_);
lock.unlock();
}
} else {
Expand Down
5 changes: 4 additions & 1 deletion suite/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4649,7 +4649,10 @@ if (BUILD_CLIENTS)
# We assume the app name starts with "s" here to avoid colliding with
# our output dir, while still letting the single precmd remove both.
"${drcachesim_path}@-simulator_type@record_filter@-indir@${testname}.s*.dir/trace@-core_sharded@-cores@4@-outdir@${testname}.filtered.dir"
"schedule_stats")
# We run opcode_mix to test encodings.
# XXX i#6684: Once we have invariant_checker support, run it here (and ensure
# it checks encodings).
"opcode_mix")

if (UNIX) # Windows multi-thread tests are too slow.
set(testname "tool.record_filter_bycore_multi")
Expand Down

0 comments on commit 8e23247

Please sign in to comment.