Early profiling using debugging API and other improvements#20
Early profiling using debugging API and other improvements#20Ashod wants to merge 6 commits intoVerySleepy:masterfrom
Conversation
|
Hi, thanks for the patch. A few questions,
|
Yes. I stopped using tabs a few years back. Can convert and resubmit.
Most are there for completeness, but some will be useful. Didn't want to be cull prematurely.
The old method could still be used as a fall-back method.
Unfortunately, attaching at any time can miss some delay-loaded DLLs, late-start threads etc. So the same disadvantages apply for any method that doesn't get notifications on these events. But debugging API offer a solution.
Correct. And it should. A debugger is notified of all major events including thread start/end and DLL loading/unloading. I'd like to see these added and used to their full extent, and had them in mind when I added the code above. |
Sorry, to clarify: There already exists some similar but unused code in the Very Sleepy codebase in the file "src\profiler\debugger.cpp".
Would it make sense to expose this as a setting the user can toggle? |
My bad. Hadn't noticed this code (I wasn't even expecting it). I guess merging is in order.
Yes. That'd be ideal. Perhaps it'd be best if I split this PR. First the 64-bit process detection code and misc changes can go in, then the debugging code (merged) then user option to control the hooking method. Thoughts? |
I do not have a preference, so feel free to do as you find more comfortable. |
|
I'll close this PR and open another. Thanks. |
A handful of improvements, most notably using the Debugger API to hook into the profilee before it starts running. This is useful for short-lived processes.
Also improved 64-bit detection and error reporting. In addition, a number of const-correctness and optimizations.
Willing to split them into separate PRs if that's more convenient.