Details
- Reviewers
markj graeme.jenkinson_cl.cam.ac.uk - Group Reviewers
DTrace
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 8028 Build 8208: CI src build Jenkins Build 8207: arc lint + arc unit
Event Timeline
Hmm, if the return is fired here, both parent and child report the same pid (the parent's pid). It would be nice if the child reported its new pid. Why not fire in fork_return() ? One might use td_dbg_sc_code to store which fork variant we should fire the probe for.
It would be more tempting to add the systrace_probe_func invocation at the end of fork_return() where the similar KTRACE probe fires (for similar reasons). Take a look at the call to ktrsysret(SYS_fork, 0, 0); for details.
Actually it was in kern_fork() that I first looked, but, we do not have access to the syscall args structure at that point. I'll dig a bit more to see if I missed a pointer that would lead me there, or figure out if there is a reasonable way to synthesize one.
You might consider adding a special entry point to systrace.c for this purpose. We technically only need sysent[SYS_fork], I think.