-
Notifications
You must be signed in to change notification settings - Fork 193
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
Add environment variable for tracking child processes #84
Conversation
The #80 issue isn't really related; these are two entirely different use cases:
Correct. This is an user error. We could probably try to detect that and print an error or something, but it's not critical. |
pid_t pid = fork(); | ||
if( pid == 0 ) { | ||
// Child | ||
if (execl("/usr/bin/ls", "/usr/bin/ls", NULL) == -1) { |
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.
Could you use the basic.c
program here instead and in the integration test verify that:
- the file for the parent is created and contains the allocations we expect,
- the file for the child is created and contains the allocations we expect (you can just grab the checks from
#[test]
for thebasic.c
, move it into a separate functions, and then call it in two places)
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.
Good idea, I changed the test to incorporate the basic
program.
docs/src/configuration.md
Outdated
If set to `1`, bytehound will also track the memory allocations of child processes spawned by the | ||
profiled process. |
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.
Could you explicitly also document that:
- this only applies to child processes which are
fork
d andexec
d, - that the
MEMORY_PROFILER_OUTPUT
needs to be set with the appropriate placeholders so that the filenames of both the parent and the child are different
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.
Done.
LGTM; thanks! |
Hi! We want to add
bytehound
to therustc-perf
suite for profiling the Rust compiler. However, the compiler is usually invoked throughcargo
, which executes manyrustc
child processes underneath. In theory this could be resolved with someRUSTC_WRAPPER
hacks, but I thought that it would be better if we could directly teachbytehound
to track child processes.I'm not sure what is the interaction of the added flag with
MEMORY_PROFILER_OUTPUT
, if it's set to a single, fixed filepath without placeholders, then the profile could be overwritten by the child processes? But that's probably user error.