[erlang-questions] erl_tracer, trace_status and pids
Loïc Hoguin
essen@REDACTED
Fri May 26 14:41:14 CEST 2017
Hello,
I am optimizing an erl_tracer tracer NIF. Can you give light on the
following questions? I tried to look into the source but want to double
check my understanding.
* trace_status is always called on enabled/3, not on enabled_*/3
* when you use enabled_*/3 and trace_*/5 functions for everything, the
trace/5 function will never be called
* trace_status is always called before any other enabled_*/3 so I should
be fine just doing nothing in enabled_*/3, right? I'm only checking that
the tracer processes are still alive anyway.
Basically if you could shed light on the circumstances around
trace_status that would help a lot for optimizing this. :-)
Another question, I have a pool of tracer processes and want to send the
events to one of them depending on the pid (all events of a pid gets to
the same tracer process). Is this a valid solution?
nth = (tracee.pid >> 4) % len;
This gives me the number of the tracer I will send the message to.
Thanks!
--
Loïc Hoguin
https://ninenines.eu
More information about the erlang-questions
mailing list