Page MenuHomeFreeBSD

fix some bugs in bsd.dep.mk dtrace rules
ClosedPublic

Authored by markj on Oct 20 2014, 9:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 14 2024, 6:39 AM
Unknown Object (File)
Jan 14 2024, 5:35 AM
Unknown Object (File)
Dec 27 2023, 11:15 AM
Unknown Object (File)
Dec 19 2023, 10:45 PM
Unknown Object (File)
Sep 1 2023, 8:41 AM
Unknown Object (File)
Jun 12 2023, 3:54 PM
Unknown Object (File)
Apr 9 2023, 6:32 AM
Unknown Object (File)
Mar 23 2023, 4:21 PM
Subscribers
None

Details

Reviewers
rpaulo
bdrewery
Summary

As part of some work to integrate the DTrace test suite with Kyua, I've been using the bsd.dep.mk rules to run dtrace -G on some of the test programs. This exposed some buglets; the change in this review attempts to fix them.

There are three changes here:

  1. Use anchors when using make(1)'s :S modifier. Without this I run into problems if I have an object called tst.foo.o and a provider script called foo.d; we were removing tst.foo.o from the object list with ${OBJS:S/foo.o//}.
  1. (This one is a bit hacky.) Make the auto-generated object file depend on the provider script and the rest of the object files. Then use ${.ALLSRC} to place them on the dtrace(1) command line. I need to do this in order to use .d files from make(1)'s .PATH. Otherwise I have no way of getting a path to the .d file in the recipe.
  1. Remove the generated header from the dep list for the generated object file, since the object file doesn't directly depend on the header. We have beforebuild: ${DHDRS} anyway, which is sufficient.
Test Plan

I can use bsd.dep.mk to build a number of test programs containing USDT probes. Prior to this change, I ran into a few problems described above.

I can still build executables, shared libs and static libs that contain USDT probes.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

markj retitled this revision from to fix some bugs in bsd.dep.mk dtrace rules.
markj updated this object.
markj edited the test plan for this revision. (Show Details)
markj added a reviewer: rpaulo.
rpaulo edited edge metadata.

I'm not sure how make anchors work and I've run into this problem before, so if it fixes it, great.
Right now, this code only lets you work with one DTrace script. I had some ideas on how to improve that, but I never worked on them.

This revision is now accepted and ready to land.Oct 20 2014, 9:19 PM
In D978#4, @rpaulo wrote:

I'm not sure how make anchors work and I've run into this problem before, so if it fixes it, great.

They're a bit different than anchors in normal REs in that they denote the beginning and end of whitespace-delimited tokens rather than newline-delimited tokens.

Right now, this code only lets you work with one DTrace script. I had some ideas on how to improve that, but I never worked on them.