Silent call trace

Raimo Niskanen <>
Wed Mar 1 18:23:33 CET 2006


I just discovered a queer behaviour in the call trace.
The man page says, concerning erlang:trace/3, trace flags:

            silent:
                Used in conjunction with  the  call  trace  flag.
                Call  tracing  is active and match specs are exe-
                cuted as normal, but no call trace  messages  are
                generated.

                Silent   mode   is   inhibited    by    executing
                erlang:trace/3  without  the silent flag, or by a
                match spec executing the  {silent,  false}  func-
                tion.

It seems the actual implementation is that a regular call
trace is not affected by the 'silent' flag. It is only when
there is a match spec on the trace point that the trace
message gets silenced. I.e an empty match spec list to
erlang:trace_pattern/3 cause trace messages to ignore
the 'silent' flag.

This could either be regarded as a bug in the documentation
because one might argue that the 'silent' flag has always
been intended to co-operate with match specs and should
therefore only affect match spec trace points,
or,
it could be regarded as a bug in the implementation that
behaves differently if there is a match spec vs an empty one.

Opinions?

Has anyone built an application needing the existing behaviour?


[ The second paragraph in the quote above from 
  the manual is also incorrect: you have to use
  e.g erlang:trace(Pid, false, [silent])
  to disable the 'silent' flag.                 ]

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list