-
Notifications
You must be signed in to change notification settings - Fork 571
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: Do not output zero-instruction (unfiltered) threads #6356
Conversation
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 could you check whether with this branch in place you no longer get that no-instruction thread? I'm not sure how to create a test to recreate that: how to have a thread reliably execute the post-futex yet not execute any instructions. |
Failure is coherence test invalid type 23 before a bundle #4167 |
I can reproduce this with the cmd line below. It happens when there is a long running test and we use
With
|
The same behaviour is seen even with this branch. |
But the tool crashed! All bets are off. The trace might be corrupted or not finalized properly. Probably raw2trace or invariant_checker will fail/complain if so and apparently they did not for you so maybe it's ok but I would be wary of it. That crash should be fixed: was an issue filed on it? |
Looks like -exit_after_tracing doesn't turn off tracing mode. We always detach which turns it off...probably we should have all exit methods do so, or otherwise enable the drop-empty-thread code. Will update the PR. |
Updated. The empty thread should no longer exist. |
I'm not seeing zero-inst traces with this branch and scheduler_launcher also seems to pass on these threads. Is detach only available with source instrumentation? I'll file an issue about the crash with |
I don't fully understand the impact of the changes in output.cpp - could maybe someone more familiar do the code review? |
Looks like we discussed it here #3346 (comment) |
Still not sure how to make a reliable test. I tried the -exit_after_tracing command and it did result in one empty thread but it had just one cpuid: it did not have a 2nd and so would not have triggered the cpuid mismatch. We may have to just go with the manual testing from @prasun3. |
…xpand ifdef to logical coverage.
This is the test that I ran
|
@derekbruening I am seeing zero-insr threads with L0_filter. Is this because there are two INSTRUCTION_COUNT markers? Cmd line
Raw file entries
Trace
|
For an instruction filter we can't really have the same standard as there could be zero instruction records but still some data records. I guess the check could look for data records too? But how is an instr-filtered trace being fed to the scheduler: it must be a warmup with no post-warmup? I had assumed the filtered part would not be asked to be scheduled. |
I originally saw the scheduling issue with a bimodal trace, and since the issue was root-caused to empty traces, the example above reproduces empty traces with filtering enabled. I thought running bimodal traces through the scheduler would be okay since they have cpu id markers, but sounds like that is not the case since it relies on instructions being present? |
We didn't really think about this use case. The basics would work but preempting by instruction count would not (so the simulator/tool would have to pass in a time value) and skipping for regions of interest or recorded schedules would not. File a separate issue on scheduler support for i-filtered traces? Maybe the rep string proposed solution Proposal #E at #6354 (comment) would also solve this. |
I am interested in just generating per-core streams so it is okay for me even if those other features you listed don't work. But I can file an issue in case it is useful in the future or to others. |
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:
Issue: #6354