Open zemse opened 3 months ago
Hi @zemse! Great work on this project, it would be great if we could get this into foundry natively :)
Do you have time for kicking off PR with this at the moment? We'd be happy to give you pointers and help with integrating everything into existing code
Sure I'll try making a PR over the weekend :)
hey @zemse I've been playing around with internal fns tracking in https://github.com/foundry-rs/foundry/pull/8222 lately in context of displaying them in traces
it is based on using the CallTraceArena
instead of DebugStep
so should be easier to integrate as it does not require using debugger logic directly.
I believe it can be reused for flamegraphs as well so feel free to use it in your PR if you find it feasible to integrate
hey @zemse! how's it going with the PR? do you need any help?
Sorry last weekend I was not in best health, couldn't start this.
I looked at your PR and it made sense. Aiming to make up something this weekend!
Component
Forge
Describe the feature you would like
I was recently interested in flamegraphs, had to hack something locally and then over the weekend packaged it as a foundry plugin: forge-flamegraph. Here is a 4-minute video demo.
The features in brief:
--open
flag which simply opens the SVG in the browser post-generation.--merge
flag which is useful when a function is called multiple times.After asking for some feedback, I've learned that there is friction because of typical solidity devs don't have Cargo installed as well as current flow of installation also requires users to build the plugin. I've created https://github.com/foundry-rs/foundry/issues/7760 to discuss potential remedies for this problem. The reason I went forward with a plugin instead of direct subcommand PR because I was mainly interested in the "debug trace flamegraph" which is very hacky and does not always work well, so I was not sure if having such experimental code in foundry codebase is fine.
But if this is helpful, I am interested to clean up the code and PR, so that these features are more accessible to people!
Additional context
No response