-
Notifications
You must be signed in to change notification settings - Fork 566
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
[drcachesim] Provide branch target for branch just prior to signal delivery #4274
Comments
To get the ind br target: we'd have to augment dr_kernel_xfer_info_t? |
It looks like the current info passed to the kernel xfer event does have
|
I was worried about a signal causing an rseq abort -- will int pc have the abort handler instead of the original interrupted pc? But it seems this has already been dealt with by #4041: /* i#4041: Provide the actually-interrupted mid-rseq PC to this event. */ |
Adds source context information to the kernel xfer event for rseq aborts, which was previously missing. To provide the interrupted rseq abort PC as the PC of the final committing store, adds logic inside DR to record that PC when it is discovered during block creation. Updates the rseq test to check the new information. Issue: #4274
Adds source context information to the kernel xfer event for rseq aborts, which was previously missing. To provide the interrupted rseq abort PC as the PC of the final committing store, adds logic inside DR to record that PC when it is discovered during block creation. Updates the rseq test to check the new information. Issue: #4274
The version number in a drmemtrace trace is currently hidden in a header that the reader hides from analysis tools. Here we add a new marker type that exports the version number so that analysis tools can handle legacy traces. Adds version awareness to the view tool. Tested by manually running the view tool: $ bin64/drrun -t drcachesim -verbose 3 -- suite/tests/bin/allasm_repstr ::4152878.4152878:: marker type 12 value 2 ::4152878.4152878:: marker type 9 value 64 ::4152878.4152878:: marker type 10 value 64 ... $ bin64/drrun -t drcachesim -offline -- suite/tests/bin/allasm_repstr $ bin64/drrun -t drcachesim -simulator_type view -indir drmemtrace.allasm_repstr.*.dir <marker: version 2> <marker: filetype 40> <marker: cache line size 64> <marker: timestamp 13269494545173426> <marker: tid 4152931 on core 2> 0x0000000000401000 48 83 e4 f0 and $0xf0, %rsp ... Issue: #4274
The version number in a drmemtrace trace is currently hidden in a header that the reader hides from analysis tools. Here we add a new marker type that exports the version number so that analysis tools can handle legacy traces. Adds version awareness to the view tool. Tested by manually running the view tool: $ bin64/drrun -t drcachesim -verbose 3 -- suite/tests/bin/allasm_repstr ::4152878.4152878:: marker type 12 value 2 ::4152878.4152878:: marker type 9 value 64 ::4152878.4152878:: marker type 10 value 64 ... $ bin64/drrun -t drcachesim -offline -- suite/tests/bin/allasm_repstr $ bin64/drrun -t drcachesim -simulator_type view -indir drmemtrace.allasm_repstr.*.dir <marker: version 2> <marker: filetype 40> <marker: cache line size 64> <marker: timestamp 13269494545173426> <marker: tid 4152931 on core 2> 0x0000000000401000 48 83 e4 f0 and $0xf0, %rsp ... Issue: #4274
For online traces, adds the interrupted PC to kernel event entries. For offline traces, updates the existing module offset stored inside kernel events (and previously used only for raw2trace) to become an absolute PC to help in core simulators and other trace consumers who want to know branch targets prior to kernel events. This is a version change for offline traces, and the version is updated, with a named constant for the old version. The raw offline's module offset is upgraded to become an index;offset pair, as that format is better suited for raw2trace and it avoids needing an extra entry nearly all of the time. The raw2trace postprocessing converts it to an absolute PC for the final trace. Since the 49 bits can take two raw entries, raw2trace is augmented to handle unreading such a double entry. Adds a new TRACE_MARKER_TYPE_RSEQ_ABORT marker to further identify an rseq abort, in order to roll back the committing store in raw2trace (previously it used the lack of interrupted-PC to identify an rseq abort). Adds support to the view tool for displaying the interrupted PC depending on the version. Updates the drcachesim documentation with the new output of the interrupted PC from the view tool. Fixes an issue in the reader where the first switch to a thread has the prior thread's identity in the two leading marker entries for version and filetype. Adds tests of the interrupted PC to the trace_invariants test for signals, as well as ensuring that raw2trace has rolled back an rseq abort final instruction so that the abort appears to occur at a legitimate place inside the region. Adds a test of the legacy version with just offsets by checking in raw files from a signal_invariants run, with fake libdrmemtrace.so and lidynamorio.so to keep the size down. Fixes #4274
…ts (#4994) For online traces, adds the interrupted PC to kernel event entries. For offline traces, updates the existing module offset stored inside kernel events (and previously used only for raw2trace) to become an absolute PC to help in core simulators and other trace consumers who want to know branch targets prior to kernel events. This is a version change for offline traces, and the version is updated, with a named constant for the old version. The raw offline's module offset is upgraded to become an index;offset pair (for 64-bit), as that format is better suited for raw2trace and it avoids needing an extra entry nearly all of the time. The raw2trace postprocessing converts it to an absolute PC for the final trace. Since the 49 bits can take two raw entries, raw2trace is augmented to handle unreading such a double entry. Adds a new TRACE_MARKER_TYPE_RSEQ_ABORT marker to further identify an rseq abort, in order to roll back the committing store in raw2trace (previously it used the lack of interrupted-PC to identify an rseq abort). Adds support to the view tool for displaying the interrupted PC depending on the version. Updates the drcachesim documentation with the new output of the interrupted PC from the view tool. Fixes an issue in the reader where the first switch to a thread has the prior thread's identity in the two leading marker entries for version and filetype. Adds tests of the interrupted PC to the trace_invariants test for signals, as well as ensuring that raw2trace has rolled back an rseq abort final instruction so that the abort appears to occur at a legitimate place inside the region. Adds a test of the legacy version with just offsets by checking in raw files from a signal_invariants run, with fake libdrmemtrace.so and lidynamorio.so to keep the size down. Fixes #4274
A final task here is to regenerate the traces in DynamoRIO/drmemtrace_samples |
For #2638 we aided core simulation of drcachesim traces by guaranteeing that a branch's target immediately followed it and would not be interrupted by a thread switch.
But then in #3937 we allowed a signal to arrive after a branch, and removed the branch target guarantee for that case.
This issue covers addressing that lack of guarantee. DR did execute that branch,
and after the signal it will go to the branch target rather than re-execute
the branch instruction. Yet the core simulator doesn't know the branch
target, especially for an indirect branch. It seems like we should figure out
a solution here. Previously we discarded the idea of explicitly storing the
branch target. Maybe we could insert the branch target as an instruction fetch
entry that gets interrupted and re-executed post-signal (easiest to do this in
the tracer as the post-processor will have a hard time finding the target, just
like a core simulator).
The text was updated successfully, but these errors were encountered: