From owner-freebsd-dtrace@FreeBSD.ORG Wed Jun 3 13:17:43 2015 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89F031ED for ; Wed, 3 Jun 2015 13:17:43 +0000 (UTC) (envelope-from eric_badger@dell.com) Received: from aussmtpmrkps320.us.dell.com (aussmtpmrkps320.us.dell.com [143.166.224.254]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "ausxipmktps31.us.dell.com", Issuer "Verizon Public SureServer CA G14-SHA1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FAD11319 for ; Wed, 3 Jun 2015 13:17:42 +0000 (UTC) (envelope-from eric_badger@dell.com) X-Loopcount0: from 76.164.8.179 X-IronPort-AV: E=Sophos;i="5.13,547,1427778000"; d="scan'208";a="286767763" From: Eric Badger To: =?iso-8859-1?Q?Mikael_=D6stlund?= , "freebsd-dtrace@freebsd.org" Subject: RE: Static probing Thread-Topic: Static probing Thread-Index: AQHQndW5S5i8DM8FkECNN94/Bi58Bp2avAky Date: Wed, 3 Jun 2015 13:17:33 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.156.107.144] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2015 13:17:43 -0000 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 =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=