How do I keep track of all but one function in an Erlang module?

I wanted to track all the functions in the erlang module since dbg:tpl

, but one of the internal functions took 95% of the trace file. Then I wanted to exclude just this single feature and found that it was not as easy as I thought it would be.

I know there are great opportunities for pattern matching for arguments when tracing.

  • Is there a similar possibility to apply pattern matching to functions?

    eg.: {'=/=', '$2', function_name}

I am open to external solutions!

Thanks!

+2


a source to share


2 answers


This can be achieved as a single combo operator:

[dbg:tpl(Mod, F, []) || {F, _Ar} <- Mod:module_info(functions), not lists:member(F, DontTrace)].

      



Where Mod

is the module you want to track and DontTrace

is the list of function names that you shouldn't track.

+5


a source


dbg:tpl(mod,[]).
dbg:ctpl(mod,notthisfunction).

      



Haven't tested this, but shouldn't that be the trick? Not sure how to do this in one line.

+1


a source







All Articles