Re: DTrace complains about struct thread

From: Roman Divacky <rdivacky_at_freebsd.org>
Date: Wed, 15 Oct 2008 14:39:53 +0200
On Wed, Oct 15, 2008 at 11:04:53AM +0200, Lionel Flandrin wrote:
> I tried to play with DTrace on a fresh FreeBSD 7.1, so I followed the
> steps described here:
> http://www.freebsd.org/doc/en/books/handbook/book.html#DTRACE
> 
> I added these options to my kernel config:
> ,----
> | options KDTRACE_HOOKS
> | options DDB_CTF
> | options KDTRACE_FRAME
> `----
> 
> And rebuilt everything with "WITH_CTF=1"
> (http://www.freebsd.org/doc/en/books/handbook/book.html#DTRACE-ENABLE
> says make *WITH_CTF*=1 buildworld and then make *WITH_CFT* afterwards,
> is it a typo? If not I think it should be more explicit because it
> really looks like one).
> 
> I restarted the computer, kldloaded the dtraceall module and dtrace -l
> seems to work right:
> ,----
> | # dtrace -l | wc -l
> |    25825
> `----
> 
> However, whenever I try to trace something, I get:
> ,----
> | # dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }'
> | dtrace: invalid probe specifier proc:::exec-success {
> | trace(curpsinfo->pr_psargs); }:
> | "/usr/lib/dtrace/psinfo.d", line 88:
> | failed to resolve type kernel`struct thread * for identifier
> | curthread: Unknown type name
> `----
> 
> Same message with ./hotkernel from the DTraceToolkit and everything
> else I've tried:
> ,----
> | "/usr/lib/dtrace/psinfo.d", line 88: failed to resolve type
> | kernel`struct thread * for identifier curthread: Unknown type name
> `----
> 
> line 88 of /usr/lib/dtrace/psinfo.d is:
> ,----
> | inline psinfo_t *curpsinfo = xlate <psinfo_t *> (curthread->td_proc);
> `----
> 
> ,----
> | # uname -a
> | FreeBSD casibsd 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Tue Oct 14
> | 11:40:44 CEST 2008 root_at_casibsd:/usr/obj/usr/src/sys/CASIBSD_CONF
> | amd64
> `----
> 
> What am I doing wrong?

if I am not mistaken FreeBSD currently does not support userland tracing.
this might be the cause, though the error message is strange

roman
Received on Wed Oct 15 2008 - 11:00:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:36 UTC