Open OnorioCatenacci opened 1 year ago
It's a pretty complicated little example snippet, TBH. The goal of this is to demonstrate the pid functionality; and you are correct that we are receiving messages for processes that should not.
The problem likely lies in how we are propagating the Matcha pid options into the recon call... So marking as a bug. I wonder if I read the recon docs wrong.
Notice that we do some extra hijinks to accept argument and pid lists and create permutations of traces. That's pretty untested, so another vector of this bug.
Oddly enough I can repeat this with an equivalent recon call, so I think I'm just failing to understand how this recon feature is supposed to be used?
Same functionality, just swapped out the Matcha
for :recon
:
IO.puts("I am: #{inspect(self())}")
# Configure the tracing engine to only monitor our `self()`
# Matcha.Trace.module(Integer, limit: 1_000, pid: self())
:recon_trace.calls({Integer, :_, :_}, 1_000, pid: self())
do_integer_things = fn ->
IO.puts("The process now executing some Integer calls is: #{inspect(self())}")
Integer.digits(123)
Integer.parse("1")
end
# Calls from this process will emit tracing messages
do_integer_things.()
# The same calls in other processes will not be traced!
IO.puts("A newly spawned process is: #{inspect(spawn(do_integer_things))}")
I was working through the trace documentation (tracing.livemd) and I ran across something that looks like it may be an error?
Running this:
gave me this output:
From the documentation it seems that #PID<0.597.0> should not get traced. Please disregard this if if I'm simply reading the docs incorrectly!