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
[hprof] Process heap profiler #6639
Conversation
CT Test Results 2 files 22 suites 8m 42s ⏱️ Results for commit ce53959. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
This PR requires #6351 merged first, and preloaded files must be updated (at least erlang.beam) to ensure Dialyzer pass. Tests in hprof_SUITE are expected to fail without #6351 merged. Several decisions I made working on
One more thing I'd love to have is |
@sverker and @frazze-jobb is there any chance to facilitate the review and testing? I'd really love to include this in OTP-26RC1 so we could start testing too. |
Rebased to the latest master, and updated with changes from #6351 (megawords removed). |
|
This is pretty neat! I have a question: my understanding is that cprof, eprof, and hprof are all based on the same structure. They set up trace patterns and then use trace_info to get information about MFAs. Shouldn't we then be trying to provide a unified API for all three? Otherwise, if I want to measure both time and heap allocation, I will need to measure twice. Not only that, because they have different APIs, we would need to change tools like Erlang's compiler to support both |
There are several considerations why I haven't done this:
However I would note that |
Thank you @max-au, that clarifies a lot. I would say that, even if you cannot run two modes at once, it would still be valuable to have a single module for profiling, except you choose a single mode instead of several. We can either support all three modes (count, time, memory) or just choose between (time and memory). The benefit being that tools like the compiler do not have to integrate two different profilers. I understand that |
Mac OS has I agree that a single |
Similar to eprof for time profiling, hprof enables heap profiling for Erlang processes. It simplifies selection of processes to trace and allows programmatic analysis.
|
@jhogberg should this be headed to OTP-26 as experimental, or it needs to wait until 26.1? |
Sorry, I missed this message :-( 26.1 sounds fine, it's a whole new tool so it won't break anyone's code unless they've squatted the |
Apologies folks, but before this module is officially released, are there any thoughts into calling this |
I was a little bit trigger happy yesterday evening, and merged this to master. (which will make it to 27). If we manage to implement multiple trace sessions for 27, then we will probably want to change the APIs as well before making it official. |
I like the idea of a generic API to rule them all. With trace sessions in place, or at least an API, would it not be possible that a new generic profiling API should reflect that with some sort of profiling session concept. |
Similar to eprof for time profiling, hprof enables heap profiling for Erlang processes. It simplifies selection of processes to trace and allows programmatic analysis.