Repository navigation
Initial support for buffered may-block syscalls. - #179
Merged
Merged
Conversation
This commit includes quite a few changes, many of which are noise or lesser bugs fixed along the way. But the crux of the approach of this patch, building on the desched event already being fired, is 0. When the desched event fires, check if the tracee has already finished the system call it was in. If so, continue normally; the call will be recorded in the buffer and replay will Just Work. 1. If the syscall really did block, then record the syscall entry normally (outside the syscallbuf), flush the syscallbuf, and mark the context as preemptible. Additionally, set things up so that the syscallbuf code *will not* commit the current syscall into the buffer when it finishes. Advance execution normally until the syscall finishes, then record the syscall exit normally. A somewhat tricky part of the implementation is that desched'd syscalls will still use the syscallbuf as "scratch storage" after the buffer has been flushed, when the event fires --- even though they're not going to commit to the buffer. This is OK because * rr records the outparams as if they were help in normal scratch buffers * the tracee hold a lock on the storage throughout * we do careful dance to replay the flushing / clearing of recorded size / marking for commit-abort in the right order One large part but relatively minor part of the patch was refactoring the code that initializes the shared buffer, because we need to share the mapping during replay now. Another large but minor part was simplifying and correcting how the scratch-buffer setup is done in prep_event(). This patch doesn't enable any may-block syscalls for buffering, but there are two included in commented-out code in syscall_buffer.c which can be used for testing.
joneschrisg
added a commit
that referenced
this pull request
Jul 3, 2013
Initial support for buffered may-block syscalls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit includes quite a few changes, many of which are noise or
lesser bugs fixed along the way. But the crux of the approach of this
patch, building on the desched event already being fired, is
finished the system call it was in. If so, continue normally; the
call will be recorded in the buffer and replay will Just Work.
normally (outside the syscallbuf), flush the syscallbuf, and mark the
context as preemptible. Additionally, set things up so that the
syscallbuf code will not commit the current syscall into the buffer
when it finishes. Advance execution normally until the syscall
finishes, then record the syscall exit normally.
A somewhat tricky part of the implementation is that desched'd
syscalls will still use the syscallbuf as "scratch storage" after the
buffer has been flushed, when the event fires --- even though they're
not going to commit to the buffer. This is OK because
size / marking for commit-abort in the right order
One large part but relatively minor part of the patch was refactoring
the code that initializes the shared buffer, because we need to share
the mapping during replay now. Another large but minor part was
simplifying and correcting how the scratch-buffer setup is done in
prep_event().
This patch doesn't enable any may-block syscalls for buffering, but
there are two included in commented-out code in syscall_buffer.c which
can be used for testing.
Resolves #7.