Thank you, worked straight away.

2015-06-03 15:17 GMT+02:00 Eric Badger <[email protected]>:

> 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 <[email protected]>
> Sent: Wednesday, June 03, 2015 3:17 AM
> To: [email protected]
> 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?
> _______________________________________________
> [email protected] mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
> To unsubscribe, send any mail to "[email protected]"
>
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
To unsubscribe, send any mail to "[email protected]"

Reply via email to