From owner-freebsd-dtrace@FreeBSD.ORG Sun Jan 26 16:27:18 2014 Return-Path: Delivered-To: dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AF0B5C3; Sun, 26 Jan 2014 16:27:18 +0000 (UTC) Received: from mail-ee0-x235.google.com (mail-ee0-x235.google.com [IPv6:2a00:1450:4013:c00::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A1C081399; Sun, 26 Jan 2014 16:27:17 +0000 (UTC) Received: by mail-ee0-f53.google.com with SMTP id t10so1838571eei.12 for ; Sun, 26 Jan 2014 08:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=kmMAvutpb+0z2iB4zoAGnwzcBwO1x6+vYTGFwoLZGhg=; b=RP/0P65BD4TafZ15F8FWNpGFy9fSL2oJOii5MZ5Jp5jIOWz8BU8BcoSbVlASvts3rD v1dKKMCtYlfhnhhxUQ9qETrYwl5CUUs1VU6FscNvRcSye804pZFrb6XGXyfoN6wCBX2G mQn2ZU+4ADnNFBKSWZZVc6kbkafal4H3+dNimZoR/hHquZM+V0QWQRn/elesBIw5i7on EO9VDvn25MMuBEp7umDfalO1tVHUFbnzbuf+Kgf0WH12s16B4o92YdQM80bmcuVlRbX4 kGfKjBrQBhllFsufooZC3PP4YoWSTbNRgMlcb26+HLshLO0MKloj7RKJDPhk9CdRLukS K+Yg== X-Received: by 10.15.43.10 with SMTP id w10mr21525642eev.13.1390753636107; Sun, 26 Jan 2014 08:27:16 -0800 (PST) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id k41sm30879655eey.0.2014.01.26.08.27.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jan 2014 08:27:15 -0800 (PST) Sender: Mikolaj Golub Date: Sun, 26 Jan 2014 18:27:13 +0200 From: Mikolaj Golub To: dtrace@freebsd.org Subject: Improvements to bsd.dtrace.mk Message-ID: <20140126162712.GA11086@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) Cc: Rui Paulo X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 26 Jan 2014 16:27:18 -0000 Hi, Trying to use bsd.dtrace.mk for building userland programs with statically defined traces, I facesed the following issues: 1) To generate a header file (e.g. provider.h) from a dtrace file (provider.d) you had to explicitly run `make depend'. 2) If a makefile included bsd.dtrace.mk and sources contained probe macros, it would fail to build when WITH_DTRACE was not defined. I.e. you couldn't build the same sources with and without dtrace probes. 3) It failed to build if you had several provider files (several files specified in DTRACEOBJS). 4) It failed if OBJDIR was not current directory. 5) It failed to rebuild dtrace objects if the old ones had not been removed before, because dtrace(1) refuses to rewrite objects. 6) It was not possible to specify additional trace(1) options (e.g. library or header directory paths). Here is my attempt to solve most of these issues: http://people.freebsd.org/~trociny/patches/bsd.dtrace.mk.3.patch The only issue remains is (1) -- necessity to run `make depend' to generate probider header files. I had also to tweak dt_program.c -- header files generation. Note, I didn't have much practice in writing makefiles, so any suggestions how this can be improved (or should be done properly) are highly appreciated. -- Mikolaj Golub