-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Attempt to gather similar stats as rusage on Windows #82754
Conversation
This comment has been minimized.
This comment has been minimized.
We spawn - at minimum - linkers as child processes, I think. |
To be honest, I only included those because they were "immediately available" and were not explicitly documented as being unused. I did not include them because I thought they were crucial statistics to gather. So I recommend you follow a similar strategy for Windows: If there are statistics that are immediately available, go ahead and print them with their own tag. This particular piece of machinery need not attempt to be 100% cross-platform, in my opinion. |
Hmm. I realize now that I might have been misreading this sentence that you have quoted. I had been interpreting it has "the resident set size of the largest descendant" (child, grandchild, et cetera), and I had been interpreting the qualification about the process tree as just pointing out that its not going to tell you about the maximum resident size that results from summing the simultaneously live children at all points in time and taking the maximum of that. But I now realize that its possible that that text is merely saying that it only tells you about the immediate children; that the data is not gathered recursively. (On the other hand: Why not gather the data recursively? A child process needs to gather it and deliver it to its parent in any case, right?) Anyway, that was just an idle thought further showing my lack of knowledge of this particular API. |
I've not seen any information that clarifies this question unfortunately...
I've pushed changes that now show more Windows specific numbers that are "immediately available". |
The implementation of r=me once rylev changes the call site according to my suggestion above. (Or provides an argument for why that would not be good.) |
@pnkfelix I cleaned this up, and it's ready for your sign off now. |
@bors r=pnkfelix |
📌 Commit 302867c has been approved by |
Attempt to gather similar stats as rusage on Windows A follow up to rust-lang#82532. This is a bit hacked in because I think we need to discuss this before merging, but this is an attempt to gather similar metrics as `libc::rusage` on Windows. Some comments on differences: * Currently, we're passing `RUSAGE_CHILDREN` to `rusage` which collects statistics on all children that have been waited on and terminated. I believe this is currently just the invocation of the real `rustc` that the shim is wrapping. Does `rustc` itself spawn children processes? The windows version gets the child processes handle when spawning it, and uses that to collect the statistics. For maxrss, `rusage` will return "the resident set size of the largest child, not the maximum resident set size of the process tree.", the Windows version will only collect statistics on the wrapped `rustc` child process directly even if some theoretical sub process has a larger memory footprint. * There might be subtle differences between `rusage`'s "resident set" and Window's "working set". The "working set" and "resident set" should both be the number of pages that are in memory and which would not cause a page fault when accessed. * I'm not yet sure how best to get the same information that `ru_minflt`, `ru_inblock`, `ru_oublock`, `ru_nivcsw ` and `ru_nvcsw` provide. r? `@pnkfelix`
Attempt to gather similar stats as rusage on Windows A follow up to rust-lang#82532. This is a bit hacked in because I think we need to discuss this before merging, but this is an attempt to gather similar metrics as `libc::rusage` on Windows. Some comments on differences: * Currently, we're passing `RUSAGE_CHILDREN` to `rusage` which collects statistics on all children that have been waited on and terminated. I believe this is currently just the invocation of the real `rustc` that the shim is wrapping. Does `rustc` itself spawn children processes? The windows version gets the child processes handle when spawning it, and uses that to collect the statistics. For maxrss, `rusage` will return "the resident set size of the largest child, not the maximum resident set size of the process tree.", the Windows version will only collect statistics on the wrapped `rustc` child process directly even if some theoretical sub process has a larger memory footprint. * There might be subtle differences between `rusage`'s "resident set" and Window's "working set". The "working set" and "resident set" should both be the number of pages that are in memory and which would not cause a page fault when accessed. * I'm not yet sure how best to get the same information that `ru_minflt`, `ru_inblock`, `ru_oublock`, `ru_nivcsw ` and `ru_nvcsw` provide. r? ``@pnkfelix``
Attempt to gather similar stats as rusage on Windows A follow up to rust-lang#82532. This is a bit hacked in because I think we need to discuss this before merging, but this is an attempt to gather similar metrics as `libc::rusage` on Windows. Some comments on differences: * Currently, we're passing `RUSAGE_CHILDREN` to `rusage` which collects statistics on all children that have been waited on and terminated. I believe this is currently just the invocation of the real `rustc` that the shim is wrapping. Does `rustc` itself spawn children processes? The windows version gets the child processes handle when spawning it, and uses that to collect the statistics. For maxrss, `rusage` will return "the resident set size of the largest child, not the maximum resident set size of the process tree.", the Windows version will only collect statistics on the wrapped `rustc` child process directly even if some theoretical sub process has a larger memory footprint. * There might be subtle differences between `rusage`'s "resident set" and Window's "working set". The "working set" and "resident set" should both be the number of pages that are in memory and which would not cause a page fault when accessed. * I'm not yet sure how best to get the same information that `ru_minflt`, `ru_inblock`, `ru_oublock`, `ru_nivcsw ` and `ru_nvcsw` provide. r? ```@pnkfelix```
Attempt to gather similar stats as rusage on Windows A follow up to rust-lang#82532. This is a bit hacked in because I think we need to discuss this before merging, but this is an attempt to gather similar metrics as `libc::rusage` on Windows. Some comments on differences: * Currently, we're passing `RUSAGE_CHILDREN` to `rusage` which collects statistics on all children that have been waited on and terminated. I believe this is currently just the invocation of the real `rustc` that the shim is wrapping. Does `rustc` itself spawn children processes? The windows version gets the child processes handle when spawning it, and uses that to collect the statistics. For maxrss, `rusage` will return "the resident set size of the largest child, not the maximum resident set size of the process tree.", the Windows version will only collect statistics on the wrapped `rustc` child process directly even if some theoretical sub process has a larger memory footprint. * There might be subtle differences between `rusage`'s "resident set" and Window's "working set". The "working set" and "resident set" should both be the number of pages that are in memory and which would not cause a page fault when accessed. * I'm not yet sure how best to get the same information that `ru_minflt`, `ru_inblock`, `ru_oublock`, `ru_nivcsw ` and `ru_nvcsw` provide. r? ````@pnkfelix````
☀️ Test successful - checks-actions |
A follow up to #82532. This is a bit hacked in because I think we need to discuss this before merging, but this is an attempt to gather similar metrics as
libc::rusage
on Windows.Some comments on differences:
RUSAGE_CHILDREN
torusage
which collects statistics on all children that have been waited on and terminated. I believe this is currently just the invocation of the realrustc
that the shim is wrapping. Doesrustc
itself spawn children processes? The windows version gets the child processes handle when spawning it, and uses that to collect the statistics. For maxrss,rusage
will return "the resident set size of the largest child, not the maximum resident set size of the process tree.", the Windows version will only collect statistics on the wrappedrustc
child process directly even if some theoretical sub process has a larger memory footprint.rusage
's "resident set" and Window's "working set". The "working set" and "resident set" should both be the number of pages that are in memory and which would not cause a page fault when accessed.ru_minflt
,ru_inblock
,ru_oublock
,ru_nivcsw
andru_nvcsw
provide.r? @pnkfelix