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

Conversation

prasun3
Copy link
Contributor

@prasun3 prasun3 commented Oct 10, 2023

Added check to verify that output stream's CPU ID matches the CPU ID markers seen in the trace.

Issue: #6354

Added check to verify that output stream's CPU ID matches the CPU ID
markers seen in the trace.

Issue: #6354
@@ -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?

derekbruening added a commit that referenced this pull request Oct 10, 2023
Tightens the normal-mode output rule to discard a thread with no
instructions (keeping the no-data check for i-filtered modes).

Adds the scheduler_launcher CPU check from PR #6355.

It is not easy to create a test with a thread that reliably executes
zero instructions yet still outputs some data.  I added an invariant
check for a zero-instruction thread and confirmed it fires on the
trace in PR #6355:

```
$ bin64/drrun -t drcachesim -simulator_type invariant_checker -indir ~/tmp/drmemtrace.schedtest.x64
Trace invariant failure in T85300 at ref # 12 (0 instrs since timestamp 13341391214912820): An unfiltered thread should have at least 1 instruction
```

Issue: #6354
@prasun3
Copy link
Contributor Author

prasun3 commented Oct 12, 2023

This issue is mostly resolved with #6356 but I still ran into a (very rare) failure. I have added a test trace where the threads have non-zero instructions, but we still see this failure.

@derekbruening
Copy link
Contributor

This issue is mostly resolved with #6356 but I still ran into a (very rare) failure. I have added a test trace where the threads have non-zero instructions, but we still see this failure.

I put the analysis into the bug proper: #6354 (comment)

derekbruening added a commit that referenced this pull request Oct 12, 2023
Tightens the normal-mode output rule to discard a thread with no
instructions (keeping the no-data check for i-filtered modes) and
expands the empty-thread behavior to include regular exit runs and not
just detach.

Adds the scheduler_launcher CPU check from PR #6355.

It is not easy to create a test with a thread that reliably executes
zero instructions yet still outputs some data. I added an invariant
check for a zero-instruction thread and confirmed it fires on the trace
in PR #6355:

```
$ bin64/drrun -t drcachesim -simulator_type invariant_checker -indir ~/tmp/drmemtrace.schedtest.x64
Trace invariant failure in T85300 at ref # 12 (0 instrs since timestamp 13341391214912820): An unfiltered thread should have at least 1 instruction
```

Issue: #6354
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.

seeing more than one cpu id on one output stream with MAP_TO_RECORDED_OUTPUT
2 participants