[erlang-questions] Measure all reductions in system

Lukas Larsson garazdawi@REDACTED
Thu Jun 9 16:11:52 CEST 2016

On Thu, Jun 9, 2016 at 3:59 PM, Max Lapshin <max.lapshin@REDACTED> wrote:

> Maybe I'm doing something wrong (processes are running outside of  in/out)
> or reductions are calculated somehow else, for example some bifs or io are
> adding more reductions to global statistics?

There shouldn't be any extra reductions from processes running in secret,
or bifs etc.

There is however an inherent gap from where you will be miss reductions
from when a process starts until you read the first reductions. Since
process_info(Pid, reductions) needs the process' main lock, you have to
wait until the target process finished executing until you get the
reduction info, so you will be about 2000 reductions late. During this time
the tracing process will be suspended, so it will be even longer until you
are able to get the initial reduction count for the remaining processes. To
get around this, maybe you just want to do a [{Pid, process_info(Pid,
reductions)} || Pid <- erlang:processes()] to get the initial reduction
count instead of reacting on trace messages.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160609/87f69919/attachment.htm>

More information about the erlang-questions mailing list