From owner-freebsd-questions@FreeBSD.ORG Thu Oct 27 04:23:31 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F819106564A for ; Thu, 27 Oct 2011 04:23:31 +0000 (UTC) (envelope-from mattdavis9@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id D46ED8FC08 for ; Thu, 27 Oct 2011 04:23:30 +0000 (UTC) Received: by gyd8 with SMTP id 8so2983560gyd.13 for ; Wed, 26 Oct 2011 21:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=DIDmxby69NxThFXxvXUWlWkylf6OafUkN/x/Jk2raqE=; b=Pqn2Sk+wqwm7xOJ8pxIe2/le/B7unLZ+t3hcbi8h4WlTXP1eqJKfKOyFoYRCcrtp2D 5/XDOjj9Ns93vRdyEHAiaHsfOB4kGVeEQWECknsjlPBy5SxBrBqU93sHU9rToWWEQuFD kl7y3OTEzTCLAkovAiFpT5AeZyKZOwTdGXvdE= Received: by 10.101.155.21 with SMTP id h21mr96262ano.69.1319688081459; Wed, 26 Oct 2011 21:01:21 -0700 (PDT) Received: from excelsa.cubinlab.ee.unimelb.edu.au (cubinlab.ee.unimelb.edu.au. [128.250.80.33]) by mx.google.com with ESMTPS id j13sm11183882ani.19.2011.10.26.21.01.19 (version=SSLv3 cipher=OTHER); Wed, 26 Oct 2011 21:01:20 -0700 (PDT) Date: Thu, 27 Oct 2011 15:01:12 +1100 From: Matt Davis To: freebsd-questions@freebsd.org Message-ID: <20111027040112.GA8955@excelsa.cubinlab.ee.unimelb.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: FreeBSD 9.0-RC1 and DTrace Userland Probes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2011 04:23:31 -0000 I upgraded my box so that I can rock the userland DTrace probes. I have been following the example at: http://wiki.freebsd.org/DTrace/userland When I am ready to build my test probe, I run 'make' as the example shows. The result of that is the following: cc -O2 -pipe -fno-omit-frame-pointer -std=gnu99 -fstack-protector -c test.c cc -O2 -pipe -fno-omit-frame-pointer -std=gnu99 -fstack-protector -o test test.o test.o: In function `main': test.c:(.text+0x29): undefined reference to `__dtrace_prober___probe__before' test.c:(.text+0x45): undefined reference to `__dtrace_prober___probe__after' *** Error code 1 Same idea as the example, but I just changed the names around. Well, so I thought I would be smart and compile just the object file with: dtrace -G -s prober.d And that stalls. `truss` is showing that dtrace is stalling after a mmap, with what looks to be a valid returned address. /* provider.d */ provider prober { probe probe__before(char *); probe probe__after(char *); }; /* test.c */ #include #include #include "provider.h" int main(void) { struct timeval tv; for ( ;; ) { sleep(1); PROBER_PROBE_BEFORE("foo"); gettimeofday(&tv, NULL); PROBER_PROBE_AFTER("bar"); } return 0; } Any insight would be wonderful. Thanks! -Matt