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#6354 test: Verify one CPU ID per stream with MAP_TO_RECORDED #6355

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions clients/drcachesim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ if (X86 AND X64 AND ZIP_FOUND)
add_test(NAME tool.scheduler_launcher
COMMAND scheduler_launcher -trace_dir ${trace_dir})
set_tests_properties(tool.scheduler_launcher PROPERTIES TIMEOUT ${test_seconds})

set(trace_dir_2
"${PROJECT_SOURCE_DIR}/clients/drcachesim/tests/drmemtrace.schedtest.x64")
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the issue seems to be that there is an empty thread in here maybe we don't want to check in this test data but rather prevent future empty traces. Maybe add an invariant check that a (non-filtered) trace has at least one instruction, too.

Copy link
Contributor

Choose a reason for hiding this comment

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

I created PR #6356 to attempt to do this but don't have a good test case: maybe you could test it in your tracing setup if that reliably generates this near-empty thread?

add_test(NAME tool.scheduler_launcher_map_to_rec
COMMAND scheduler_launcher -trace_dir ${trace_dir_2} -cpu_schedule_file
${trace_dir_2}/cpu_schedule.bin.zip)
set_tests_properties(tool.scheduler_launcher_map_to_rec PROPERTIES TIMEOUT ${test_seconds})
endif ()

# We have a companion test built using a separate --build-and-test CMake project in
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions clients/drcachesim/tests/scheduler_launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,21 @@ simulate_core(int ordinal, scheduler_t::stream_t *stream, const scheduler_t &sch
thread_sequence += 'A' + static_cast<char>(input % 26);
cur_segment_instrs = 0;
}
} else if (record.marker.type == dynamorio::drmemtrace::TRACE_TYPE_MARKER) {
if (record.marker.marker_type ==
dynamorio::drmemtrace::TRACE_MARKER_TYPE_CPU_ID) {
#ifdef HAS_ZIP
if (!op_cpu_schedule_file.get_value().empty()) {
int cpu = (int)record.marker.marker_value;
int output_cpuid = stream->get_output_cpuid();
if (cpu != output_cpuid) {
FATAL_ERROR(
"CPU marker differs from output stream CPU ID: %d != %d\n",
cpu, output_cpuid);
}
}
#endif
}
}
#ifdef HAS_ZIP
else if (record.marker.type == dynamorio::drmemtrace::TRACE_TYPE_MARKER) {
Expand Down
Loading