Date: Thu, 27 Oct 2011 15:01:12 +1100 From: Matt Davis <mattdavis9@gmail.com> To: freebsd-questions@freebsd.org Subject: FreeBSD 9.0-RC1 and DTrace Userland Probes Message-ID: <20111027040112.GA8955@excelsa.cubinlab.ee.unimelb.edu.au>
next in thread | raw e-mail | index | archive | help
I upgraded my box so that I can rock the userland DTrace probes. I have been following the example at: http://wiki.freebsd.org/DTrace/userland When I am ready to build my test probe, I run 'make' as the example shows. The result of that is the following: cc -O2 -pipe -fno-omit-frame-pointer -std=gnu99 -fstack-protector -c test.c cc -O2 -pipe -fno-omit-frame-pointer -std=gnu99 -fstack-protector -o test test.o test.o: In function `main': test.c:(.text+0x29): undefined reference to `__dtrace_prober___probe__before' test.c:(.text+0x45): undefined reference to `__dtrace_prober___probe__after' *** Error code 1 Same idea as the example, but I just changed the names around. Well, so I thought I would be smart and compile just the object file with: dtrace -G -s prober.d And that stalls. `truss` is showing that dtrace is stalling after a mmap, with what looks to be a valid returned address. /* provider.d */ provider prober { probe probe__before(char *); probe probe__after(char *); }; /* test.c */ #include <unistd.h> #include <sys/time.h> #include "provider.h" int main(void) { struct timeval tv; for ( ;; ) { sleep(1); PROBER_PROBE_BEFORE("foo"); gettimeofday(&tv, NULL); PROBER_PROBE_AFTER("bar"); } return 0; } Any insight would be wonderful. Thanks! -Matt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111027040112.GA8955>