[dtrace-discuss] What''s wrong with this script

Bryan Cantrill
Wed, 17 Aug 2005 17:38:32 -0000

On Thu, Aug 18, 2005 at 01:19:29AM +0800, CHao-Hong Guo
wrote:
> hi, guys,
>
> I write a simple script as follow,
>
>
> #!/usr/sbin/dtrace -Fs
>
>
> syscall::ioctl:entry
> /execname == "test.exe"/
> {
> self->trace = 1;
> printf("fd: %d", arg0);
> }
>
> fbt:::
> /self->trace/
> {
> }
>
> syscall::ioctl:return
> /execname == "test.exe"/
> {
> self->trace = 0;
> }
>
>
> When I run this script on my laptop (NEC Versa1000, snv_19),
> the sytem is frozen.

Yikes -- that''s bad.  What do you mean by "frozen" exactly?
Does the
system reboot?  Does DTrace work at all on this machine?  (That is,
could you confirm that "dtrace -n BEGIN''{exit(0)}''"
works?)  Are you
running KMDB?  If so, does it happen when KMDB is not running?  And can
you send us the output of modinfo?

> could you tell me what ''s wrong with this script?

Nothing''s wrong with the script -- that should work.  (And indeed, many
of run scripts like that all the time on latest bits...)

	- Bryan

--------------------------------------------------------------------------
Bryan Cantrill, Solaris Kernel Development.       http://blogs.sun.com/bmc