I would like to trace all behavior of Erlang GC using dbg:tracer and print out the tracked events.
1> dbg:tracer().
2> dbg:p(self(), [garbage_collection]).
3> my_module:function([Args]).
4> dbg:stop().
5> dbg:show_trace().
...
I would like to only trace garbage collection during the execution of my_module:function/0
function call. Once the function has returned tracing should stop.