NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

dtrace newbie



I'm trying out dtrace, and wonder how the "-c" option to create a process
is meant to work.

# cat foo.d
proc:::exec
{
        trace("hello");
        exit(0);
}
# dtrace -s foo.d                           Then type "ls" in another xterm
dtrace: script 'foo.d' matched 1 probe
dtrace: buffer size lowered to 2m
CPU     ID                    FUNCTION:NAME
  2      6                            :exec   hello                            

# dtrace -s foo.d -c ls

and in other xterm top shows:

  PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU COMMAND
  738 root      29    0    52M   11M CPU/3      0:54 99.17% 92.53% dtrace

Running "ls" in another xterm just in case doesn't stop it. Finally:

^Csorry, pid 554 was killed: orphaned traced process

I was expecting "-c ls" to run /bin/ls after the proc:::exec probe was set...
What am I missing?


Cheers,

Patrick


Home | Main Index | Thread Index | Old Index