From owner-freebsd-dtrace@FreeBSD.ORG Wed Jun 3 08:17:18 2015 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 923BD460 for ; Wed, 3 Jun 2015 08:17:18 +0000 (UTC) (envelope-from mikael.ostlund.93@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 353FD19E8 for ; Wed, 3 Jun 2015 08:17:15 +0000 (UTC) (envelope-from mikael.ostlund.93@gmail.com) Received: by wiga1 with SMTP id a1so5153080wig.0 for ; Wed, 03 Jun 2015 01:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=vnovDZMd2sf0vtSmWUypUIVnji5NfBAarWz6xttP42U=; b=YNmvZe4WhoDgVTE0kcNddCKxM8xxbJI22SOHzJDi4oGbyTJHhRRjfVKLdHmHmJLtGu L6WZqa58Wh0m6YUSG1id+CMZlXQbSOJ3Km1OsVJ3qluJfeUVVd4Ymo27MJIL9NvaB1ac FCDu44m1obITRe7KFAbYeWPHmsnVbhhWKLMuTyiIITyYNSNvwMGsUHf/FZWp92XLjXVp 7hsUCEbZ8/kpJ9ZJ0TQpJhOCXngd2w9KKIMZNfNvUzQlEEx50Y7+eJM18wTqP9HlF6DG GttY2iXnCTRrqPe8OgBbiSuBVUGAPGzD2e1N/VCtVyhTfrkyw69C2vc+48T6DIqkfFQW XYmA== MIME-Version: 1.0 X-Received: by 10.180.103.227 with SMTP id fz3mr39367439wib.45.1433319433621; Wed, 03 Jun 2015 01:17:13 -0700 (PDT) Received: by 10.28.97.66 with HTTP; Wed, 3 Jun 2015 01:17:13 -0700 (PDT) Date: Wed, 3 Jun 2015 10:17:13 +0200 Message-ID: Subject: Static probing From: =?UTF-8?Q?Mikael_=C3=96stlund?= To: freebsd-dtrace@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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 08:17:18 -0000 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? 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= From owner-freebsd-dtrace@FreeBSD.ORG Wed Jun 3 14:21:14 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 AB998E5 for ; Wed, 3 Jun 2015 14:21:14 +0000 (UTC) (envelope-from mikael.ostlund.93@gmail.com) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9B51282 for ; Wed, 3 Jun 2015 14:21:14 +0000 (UTC) (envelope-from mikael.ostlund.93@gmail.com) Received: by wgme6 with SMTP id e6so10606447wgm.2 for ; Wed, 03 Jun 2015 07:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RVh6OPLw4/MnNpXf9L9f7wjCDC7SIVkU/UjfI+GWeR8=; b=DJeLGuZXHW7m42pXOovZzP0fkPxpDrfvhIZvgazlWV/4MngxIRra2oDnpk0w469qUS KjkVKrH38McnOwKiUn5ZbLWBxeoGeSk9NuPfBFIrXUaNoFbkwd19Sql9YZUXSPfkjWYa AIatckraEPEfcsAfNbSKR0k2/09sEM6hHue5cnpNEgJ2NABP8q54yNeM+WICb7keRL0D vAHqlK2DkFoO3YozWHqepQuVSo9+kOe2nog+6fQKwdjy5FAdhhSYruyj64cglUgnfWzG yERcT8epi9hkKvPDWeQvq2M6lIQv6yCqgS9hwMXL4pvXNf7iXAh/IIKCm4N6cOPNVcQN JO1w== MIME-Version: 1.0 X-Received: by 10.195.13.1 with SMTP id eu1mr62339474wjd.131.1433341272489; Wed, 03 Jun 2015 07:21:12 -0700 (PDT) Received: by 10.28.97.66 with HTTP; Wed, 3 Jun 2015 07:21:12 -0700 (PDT) In-Reply-To: References: Date: Wed, 3 Jun 2015 16:21:12 +0200 Message-ID: Subject: Re: Static probing From: =?UTF-8?Q?Mikael_=C3=96stlund?= To: Eric Badger Cc: "freebsd-dtrace@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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 14:21:14 -0000 Thank you, worked straight away. 2015-06-03 15:17 GMT+02:00 Eric Badger : > 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 > 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" >