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

Kris Van Hees kris.van.hees at oracle.com
Wed Jul 31 19:21:06 UTC 2024


General comments because my review covers the entire series...

Why are there two pkg_config files being introduced when it seems like a
single dtrace.pc one would be sufficient.  The dtrace utility is used both
for tracing and for the building of libraries and executables with USDT
probes,  I see no reason why a single dtrace.pc couldn't cover both.

On that note, why can't pkg-config then also be used as a means to get the
location of the dtrace executable?  Why go through the trouble of performing
text substitution on runtest.sh to insert the location of dtrace when you
already use pkg-config in it to get the appropriate include directory for
the installed case.

I think this series needs to be reworked to be consistent.  If we are going
to use pkg-config, then let's use it to its fullest extent rather than using
it for some stuff but then still hardcoding other things.  That makes no sense
to me.

On Fri, May 31, 2024 at 07:59:19PM +0100, Nick Alcock via DTrace-devel wrote:
> 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
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list