[erlang-questions] Setting the trace token in a spawned process

Knut Nesheim knutin@REDACTED
Thu Nov 17 12:34:07 CET 2011


Hello list,

I'm using the sequential trace infrastructure for writing a
profiler[1]. I have run into a problem that I have hacked around, but
I'm now searching for a proper solution.

When a process that has the sequential trace token spawns a new
process, the child process will not inherit the trace token if you
don't send a message from the parent to the child. I have worked
around this by manually retrieving the token from the parent before
spawning and manually setting it in the child. This is not nice as it
requires patching legacy systems if you want to use the profiler.

Is there any way with the existing VM to set the trace token in the
child process? Would it be possible to change the VM to set the trace
token also in the child?

[1]: github.com/knutin/kprof

Thanks
Knut



More information about the erlang-questions mailing list