Why DTrace sensor is listed but not called?

Yuri yuri at rawbw.com
Tue Jan 22 19:41:39 UTC 2013


I tried to create my own DTrace sensors (for debugging purposes) through 
adding of the simple function like this:
static u_int
xxx_my_trace(int arg) {
   return 1;
}

It is listed in dtrace -l with its entry and return sensors.
  8143        fbt            kernel                 xxx_my_trace entry
  8144        fbt            kernel                 xxx_my_trace return
This function is called, I know for sure because it is called from 
another procedure which does get traced by DTrace.
However, these sensors are never triggered when run through dtrace(1M)
#!/usr/sbin/dtrace -s
::xxx_my_trace:entry
{
   printf("xxx_my_trace");
}
It does print the following, but nothing else:
dtrace: script './dt.d' matched 1 probe

Adding __attribute__((noinline)) doesn't help.

What is the problem? Why dtrace sensors aren't invoked?

Yuri


More information about the freebsd-hackers mailing list