Erlang-DTrace

5 views
Skip to first unread message

G Bulmer

unread,
Mar 10, 2008, 7:33:26 AM3/10/08
to Tim Becker, Erlang DTrace group

I've made a bit more progress. I've had a first cut at DTrace probes
in register/2, unregister/1, and a first cut at spawn/3.

So it is possible to monitor a process being registered as an atom,
and the atom unregisterd, which is rather useful. This will allow
DTrace scripts to monitor which processes are created by a process
registered as a specific atom.

My first cut at spawn/3 is a real disappointment as most spawn calls
get turned into spawn( erlang:apply ...), so the module and function
information is buried in a list, which I'll have to go traverse within
the C code.

So, output looks a bit like:
erlang*:::dtrace-register <0.0.0> 'init' (actual size:4) <0.0.0>
erlang*:::dtrace-spawn <0.0.0> module='erlang' (actual size:6)
function='apply' (actual size:5) <0.1.0>
erlang*:::dtrace-spawn <0.1.0> module='erlang' (actual size:6)
function='apply' (actual size:5) <0.2.0>
erlang*:::dtrace-register <0.1.0> 'erl_prim_loader' (actual size:15)
<0.2.0>
erlang*:::dtrace-spawn <0.1.0> module='heart' (actual size:5)
function='init' (actual size:4) <0.3.0>
erlang*:::dtrace-register <0.3.0> 'heart' (actual size:5) <0.3.0>
erlang*:::dtrace-unregister <0.3.0> 'heart' (actual size:5)
erlang*:::dtrace-spawn <0.1.0> module='proc_lib' (actual size:8)
function='init_p' (actual size:6) <0.4.0>
erlang*:::dtrace-register <0.4.0> 'error_logger' (actual size:12)
<0.4.0>
...
erlang*:::dtrace-register <0.11.0> 'global_name_server' (actual size:
18) <0.11.0>
erlang*:::dtrace-spawn <0.11.0> module='erlang' (actual size:6)
function='apply' (actual size:5) <0.12.0>
erlang*:::dtrace-spawn <0.11.0> module='erlang' (actual size:6)
function='apply' (actual size:5) <0.13.0>
erlang*:::dtrace-spawn <0.11.0> module='erlang' (actual size:6)
function='apply' (actual size:5) <0.14.0>
erlang*:::dtrace-spawn <0.9.0> module='erlang' (actual size:6)
function='apply' (actual size:5) <0.20.0>

For this dtrace script:

test_dtrace_spawn.d
Reply all
Reply to author
Forward
0 new messages