Stratus3D / eflambe

A tool for rapid profiling of Erlang and Elixir applications
Apache License 2.0
112 stars 15 forks source link

Fix premature stop_trace in recursive calls #14

Closed TheFirstAvenger closed 2 years ago

TheFirstAvenger commented 2 years ago

While eFlambe correctly detects that a trace is already running (e.g. in a recursive situation) and doesn't start it again, it still stops the trace when that internal recursive call completes, instead of waiting for the top level call that started the trace to complete. This results in truncated traces and also a not_mocked error when the outer call tries to unload meck.

This PR resolves this by only unloading meck when the call that started the trace terminates.

Stratus3D commented 2 years ago

Thanks for the PR @TheFirstAvenger ! Tests and dialyzer are failing. It looks like this is due to some of the code not having been updated to handle the start_trace/3 return value. I updated them locally and now everything is passing.

Stratus3D commented 2 years ago

I pushed an additional commit - https://github.com/Stratus3D/eflambe/pull/16

Stratus3D commented 2 years ago

Version 0.2.3 has been published to hex!

TheFirstAvenger commented 2 years ago

Thanks!