Date: Wed, 3 Jun 2015 16:21:12 +0200 From: =?UTF-8?Q?Mikael_=C3=96stlund?= <mikael.ostlund.93@gmail.com> To: Eric Badger <eric_badger@dell.com> Cc: "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org> Subject: Re: Static probing Message-ID: <CAGFZuoTfE3CiAc3TWgOY7NOrYy3h16Em8u1P3RWJpGMzvVqFCA@mail.gmail.com> In-Reply-To: <e85300bf53e141a1987151a002b62643@mspexmb1.Beer.Town> References: <CAGFZuoSC=yMMkOaNHvCU3nhEZov5z4P1Za-kzohEt6_TmjX21A@mail.gmail.com> <e85300bf53e141a1987151a002b62643@mspexmb1.Beer.Town>
next in thread | previous in thread | raw e-mail | index | archive | help
Thank you, worked straight away. 2015-06-03 15:17 GMT+02:00 Eric Badger <eric_badger@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 =C3=96stlund <mikael.ostlund.93@gmail.com> > Sent: Wednesday, June 03, 2015 3:17 AM > To: freebsd-dtrace@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@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGFZuoTfE3CiAc3TWgOY7NOrYy3h16Em8u1P3RWJpGMzvVqFCA>