пятница, 3 сентября 2010 г.

DTrace: it's really cool to have it working in FreeBSD

I've just managed to enable DTrace in FreeBSD and was playing a bit with it.
I've added necessary for i386 options to my kernel config:
options KDTRACE_HOOKS
options DDB_CTF

then run:
make kernel WITH_CTF=1 KERNCONF=MyKern

and received nothing good. The only working thing was dtrace -l. Everything other complained on uid_t in psinfo.d.

ctfdump showed a lot of stuff in kernel, but there was no uid_t. So, after adding the following line to my kernel config:
makeoptions DEBUG=-g

I got working dtrace!

So, now I can launch something like this...
# dtrace -qn 'syscall::open:entry { printf ("%d %s %s\n",pid,execname,copyinstr(arg0)) ; }'
1297 sh /lib/libncurses.so.8
1297 sh /lib/libc.so.7
1297 id /etc/libmap.conf
1297 id /var/run/ld-elf.so.hints
1297 id /usr/lib/libbsm.so.3
1297 id /lib/libc.so.7
1296 make /usr/ports/Mk/bsd.licenses.mk
1296 make /usr/ports/Mk/bsd.sites.mk
1298 sh /etc/libmap.conf
1298 sh /var/run/ld-elf.so.hints
1298 sh /lib/libedit.so.7
1298 sh /lib/libncurses.so.8
1298 sh /lib/libc.so.7
1298 sysctl /etc/libmap.conf
1298 sysctl /var/run/ld-elf.so.hints
1298 sysctl /lib/libc.so.7
1296 make .depend
1299 sh /etc/libmap.conf
1299 sh /var/run/ld-elf.so.hints
1299 sh /lib/libedit.so.7
1299 sh /lib/libncurses.so.8
1299 sh /lib/libc.so.7
1299 rm /etc/libmap.conf
1299 rm /var/run/ld-elf.so.hints
1299 rm /lib/libc.so.7
1299 rm .
1299 rm /usr/ports/textproc/libxml2/work
1299 rm libxml2-2.7.7

Комментариев нет:

Отправить комментарий