Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jun 2015 13:17:33 +0000
From:      Eric Badger <eric_badger@dell.com>
To:        =?iso-8859-1?Q?Mikael_=D6stlund?= <mikael.ostlund.93@gmail.com>, "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org>
Subject:   RE: Static probing
Message-ID:  <e85300bf53e141a1987151a002b62643@mspexmb1.Beer.Town>
In-Reply-To: <CAGFZuoSC=yMMkOaNHvCU3nhEZov5z4P1Za-kzohEt6_TmjX21A@mail.gmail.com>
References:  <CAGFZuoSC=yMMkOaNHvCU3nhEZov5z4P1Za-kzohEt6_TmjX21A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
You must have DTrace generate a .o file to provide the missing function. So=
mething like:=0A=
=0A=
dtrace -h -s provider.d=0A=
cc -c dtracetest.c -o dtracetest.o=0A=
dtrace -G -s provider.d dtracetest.o=0A=
cc dtracetest.o provider.o -o dtracetest -lelf=0A=
=0A=
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.=0A=
=0A=
Eric=0A=
________________________________________=0A=
From: Mikael =D6stlund <mikael.ostlund.93@gmail.com>=0A=
Sent: Wednesday, June 03, 2015 3:17 AM=0A=
To: freebsd-dtrace@freebsd.org=0A=
Subject: Static probing=0A=
=0A=
Hello,=0A=
=0A=
I'm experimenting with DTrace on my system and I'm not able to use static=
=0A=
probing in my code.=0A=
=0A=
Here's my c code:=0A=
=0A=
#include "provider.h"=0A=
=0A=
int main(void) {=0A=
  TESTPROVIDER_TEST_START("hello");=0A=
  return (0);=0A=
}=0A=
=0A=
And here's my provider.d file:=0A=
=0A=
provider testprovider {=0A=
    probe test__start(char *);=0A=
    probe test__done(char *);=0A=
};=0A=
=0A=
This is the error message I get when I try to compile my c file:=0A=
=0A=
# gcc dtracetest.c=0A=
/tmp//ccjWNu6v.o: In function `main':=0A=
dtracetest.c:(.text+0xa): undefined reference to=0A=
`__dtrace_testprovider___test__start'=0A=
collect2: error: ld returned 1 exit status=0A=
=0A=
(Same message no matter what compiler I try), any ideas?=0A=
_______________________________________________=0A=
freebsd-dtrace@freebsd.org mailing list=0A=
https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace=0A=
To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org"=
=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e85300bf53e141a1987151a002b62643>