Static probing
Mikael Östlund
mikael.ostlund.93 at gmail.com
Wed Jun 3 14:21:14 UTC 2015
Thank you, worked straight away.
2015-06-03 15:17 GMT+02:00 Eric Badger <eric_badger at dell.com>:
> You must have DTrace generate a .o file to provide the missing function.
> Something like:
>
> dtrace -h -s provider.d
> cc -c dtracetest.c -o dtracetest.o
> dtrace -G -s provider.d dtracetest.o
> cc dtracetest.o provider.o -o dtracetest -lelf
>
> The standard makefile bsd.prog.mk also knows how to handle .d files in
> the SRCS list and will take care of things for you.
>
> Eric
> ________________________________________
> From: Mikael Östlund <mikael.ostlund.93 at gmail.com>
> Sent: Wednesday, June 03, 2015 3:17 AM
> To: freebsd-dtrace at freebsd.org
> Subject: Static probing
>
> Hello,
>
> I'm experimenting with DTrace on my system and I'm not able to use static
> probing in my code.
>
> Here's my c code:
>
> #include "provider.h"
>
> int main(void) {
> TESTPROVIDER_TEST_START("hello");
> return (0);
> }
>
> And here's my provider.d file:
>
> provider testprovider {
> probe test__start(char *);
> probe test__done(char *);
> };
>
> This is the error message I get when I try to compile my c file:
>
> # gcc dtracetest.c
> /tmp//ccjWNu6v.o: In function `main':
> dtracetest.c:(.text+0xa): undefined reference to
> `__dtrace_testprovider___test__start'
> collect2: error: ld returned 1 exit status
>
> (Same message no matter what compiler I try), any ideas?
> _______________________________________________
> freebsd-dtrace at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
> To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe at freebsd.org"
>
More information about the freebsd-dtrace
mailing list