Instrumenting Erlang code

Attila Rajmund Nohl attila.r.nohl@REDACTED
Mon Jan 27 12:33:31 CET 2020


Frank Muller <frank.muller.erl@REDACTED> ezt írta (időpont: 2020.
jan. 26., V, 13:58):
>
> Hi everyone
>
> I would like to implement a custom instrumentation module for my Erlang code.
[...]
> f2() ->
>   instrument:start(),
>
>   receive ->
>     {msg1, M1} -> instrument:end(), M1;
>     {msg2, M2} -> instrument:end(), M2;
>     _ -> instrument:end(), f2()
>   end.
>
> Is that doable?

My (not really thought out) idea is that you could use dbg to start a
process that receives a messages when f2 is called and is returning.
If instrument:start or instrument:end does not need to execute in the
same process as f2, then it might work.



More information about the erlang-questions mailing list