Improvements to bsd.dtrace.mk

Mikolaj Golub trociny at FreeBSD.org
Sun Jan 26 16:27:18 UTC 2014


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


More information about the freebsd-dtrace mailing list