DTrace/FreeBSD source snapshot

Andrew Pogrebennyk marduk at portaone.com
Fri Feb 1 22:47:11 UTC 2008

Andrew Gallatin wrote:
> Andrew Pogrebennyk writes:
>  > In function 'dtrace_ioctl':
>  > /usr/src/sys/modules/dtrace/dtrace/../../../cddl/dev/dtrace/dtrace_ioctl.c:294:
>  > warning: format '%zd' expects type 'signed size_t', but argument 4 has
>  > type 'uint64_t'
>  > *** Error code 1
> I'm on amd64, so I did not see these warnings :)
> BTW, if you forget options KTDTRACE_HOOKS, and try to
> preload dtraceall, things explode rather spectacularly:
> [...]
>        <repeating traps forever>
> I then rebuilt with KDTRACE_HOOKS.  This time, I had
> another missing symbol (syscallnames).  I'm about out of time
> for today..
> Drew

OK, thanks for interesting info. However I got stuck with kernel module 
compilation. There were two minor discrepancies between 
/usr/src/sys/cddl/dev/dtrace/i386/dtrace_subr.c and 
/usr/src/sys/sys/dtrace_bsd.h (different types if declaration and 
definition of dtrace_trap() function and missing declaration of 
dtrace_sync_func()). I solved that and now it complains on the word 
"type" in dtrace_trap():

In function 'dtrace_trap':
error: 'type' undeclared (first use in this function)

Indeed, where it should be taken from?

/* Function to handle DTrace traps during probes. See i386/i386/trap.c */
dtrace_trap(struct trapframe *frame)
          * A trap can occur while DTrace executes a probe. Before
          * executing the probe, DTrace blocks re-scheduling and sets
          * a flag in it's per-cpu flags to indicate that it doesn't
          * want to fault. On returning from the the probe, the no-fault
          * flag is cleared and finally re-scheduling is enabled.
          * Check if DTrace has enabled 'no-fault' mode:
         if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) 
!= 0) {
                  * There are only a couple of trap types that are expected.
                  * All the rest will be handled in the usual way.
                 switch (type) {
                 /* General protection fault. */
                 case T_PROTFLT:
                         /* Flag an illegal operation. */

Andrew Pogrebennyk

More information about the freebsd-current mailing list