[DTrace-devel] [PATCH 0/9] relocatable DTrace

Nick Alcock nick.alcock at oracle.com
Fri May 31 18:59:19 UTC 2024


This relatively simple patch series makes DTrace work with non-default
(s)bindir, libdir, includedir (changing the other installation-directory
variables largely worked already).

We add a pkg-config file named dtrace.pc for the consumer headers
<dtrace.h> and <sys/dtrace.h> and for libdtrace.so: I expect there are
no users of these outside DTrace proper at all right now, but providing
this means we can point future users at a suitable pkg-config file so
they can automatically adapt to dtraces installed wherever you please.

There is one wrinkle, which is that the udev and (especially) systemd
service files for dtprobed have to be installed somewhere where udev and
systemd can see them.  We emit a warning if they don't end up in either
of the two fixed locations where systemd looks for such things, unless
the user has explicitly passed in --with-systemd-unit-dir=, in which
case we presume that the user is doing that because they know that their
systemd is looking somewhere else too and is pointing the DTrace build
system at it.

(We add an extra makefile target to allow users to forcibly install the
systemd service file even if we have not installed it by default because
we think that it won't be used. Users/distributors installing DTrace in
--prefix=/usr or --prefix=/usr/local will never need to worry about any
of this: in these cases we install the service file as before because we
know that systemd will find it).

(The first of these patches has already been submitted on its own,
but this series relies on it so I thought it might be clearest to
resubmit it as part of this series too.)

(Multiple test runs with non-default values of prefix, sbindir, libdir,
includedir, and systemd-unit-dir passed OK with no failures I can
attribute to relocating things.)

Nick Alcock (9):
  spec: install sdt*.h in /usr/lib64/dtrace/include/sys
  build: initial pkg-config support
  build: track configured vars
  build: --bindir is supposed to be equivalent to --sbindir
  build: the TESTDIR is relative to the LIBDIR by default
  build: add a pkg-config file for dtrace consumers: use it
  tests: delete the kernel build dir stuff
  build: make dtrace and dtprobed relocatable
  test: work when relocated

 Build                                         |  1 +
 GNUmakefile                                   |  6 ++--
 Maketargets                                   |  3 ++
 cmd/Build                                     |  4 +--
 configure                                     | 11 +++---
 dtprobed/Build                                | 36 ++++++++++++++-----
 .../{dtprobed.service => dtprobed.service.in} |  2 +-
 dtrace.spec                                   | 23 +++++-------
 runtest.conf.example                          | 10 ------
 runtest.sh                                    | 33 +++--------------
 test/unittest/usdt/tst.manyprocs.sh           |  2 +-
 test/unittest/usdt/tst.multitrace.sh          |  2 +-
 uts/Build                                     | 16 ++++++++-
 uts/dtrace.pc.in                              |  8 +++++
 uts/dtrace_sdt.pc.in                          |  6 ++++
 15 files changed, 87 insertions(+), 76 deletions(-)
 rename dtprobed/{dtprobed.service => dtprobed.service.in} (95%)
 delete mode 100644 runtest.conf.example
 create mode 100644 uts/dtrace.pc.in
 create mode 100644 uts/dtrace_sdt.pc.in


base-commit: 454c6d47bf408415f7eb52ea701779f041aa6957
-- 
2.45.1.275.g567cb0950c




More information about the DTrace-devel mailing list