-
Notifications
You must be signed in to change notification settings - Fork 236
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
Make Process's strace file shareable across Processes #2971
Conversation
When we fork a Process, the child will use the same strace file (if any). This is analogous to `strace -f`. Progress on shadow#1987.
strace_logging: Option<StraceLogging>, | ||
// strace logging file, if any. Shared with forked Processes. | ||
strace_logging: Option<RootedRc<RootedRefCell<StraceLogging>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be simpler by just cloning/duping (File::try_clone
) the file instead of sharing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that sounds much simpler :)
strace_logging: Option<StraceLogging>, | ||
// strace logging file, if any. Shared with forked Processes. | ||
strace_logging: Option<RootedRc<RootedRefCell<StraceLogging>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the RootedRefCell
needed? I don't think we need to mutate the format options at runtime, and the file is already inside a RefCell
. If it's needed for Send
/Sync
or something, maybe replace the RefCell
in StraceLogging
with RootedRefCell
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, otherwise the inner RefCell
can't go inside the RootedRc
, since it's not Sync
. I'll take a look at replacing the inner RefCell
instead if File::try_clone
doesn't work out.
Obsoleted by adding |
When we fork a Process, the child will use the same strace file (if any). This is analogous to
strace -f
.Progress on #1987.