[PATCH v2 0/6] stapsdt provider: simple system-wide probing
Alan Maguire <[email protected]> Mon, 5 Jan 2026 12:27:22 +0000
| Newsgroups | dev.linux.lists.dtrace |
|---|---|
| Message-ID | <[email protected]> |
This series adds wildcard support to stapsdt probes to allow tracing system-wide; this has caveats due to the way the kernel implements probe addition. In essence, probes are added on a per-inode basis (actually in the VMA associated with the inode) so it is necessary to identify the file where probes are found. Probes will fire for existing and new processes (the RFC incorrectly said they will not work for existing binaries; they in fact do). Patch 1 describes the approach; to facilitate systemwide tracing we need to tell DTrace the name of the binary/library via the module field in the probe specifier; we then use [LD_LIBRARY_]PATH to resolve the full path. ELF reading of the file and insertion of probes then proceeds in a similar manner to per-pid tracing. Full path specification in module name is not supported since DTrace does not allow a '/' in a module name. Patches 2-5 test various aspects of systemwide probes; basic binary support, library support, listing support and is-enabled probes support. Patch 6 updates docs to describe wildcard support. Changes since RFC: - update documentation/commit messages to reflect that we also catch existing programs/libraries when probes are enabled - fixup provider name for wildcard probes to be 'provider*' rather than using the confusing 'provider-1' since the latter is the concatenation of probename and pid (-1 is used to connote all pids) - add test for is-enabled systemwide probes Alan Maguire (6): stapsdt provider: support systemwide probing test: add systemwide stapsdt note test test: add systemwide stapsdt note test for library stapsdt: add test for listing systemwide probes in object stapsdt: add systemwide test for is-enabled probes documentation: update stapsdt docs to describe wildcard support .../reference/dtrace_providers_stapsdt.md | 45 ++++- libdtrace/dt_pid.c | 158 ++++++++++++---- libdtrace/dt_prov_uprobe.c | 17 +- .../tst.stapsdt-notes-systemwide-isenabled.r | 13 ++ .../tst.stapsdt-notes-systemwide-isenabled.sh | 177 ++++++++++++++++++ .../usdt/tst.stapsdt-notes-systemwide-l.sh | 48 +++++ .../usdt/tst.stapsdt-notes-systemwide-lib.r | 14 ++ .../usdt/tst.stapsdt-notes-systemwide-lib.sh | 142 ++++++++++++++ .../usdt/tst.stapsdt-notes-systemwide-lv.sh | 48 +++++ .../usdt/tst.stapsdt-notes-systemwide.r | 2 + .../usdt/tst.stapsdt-notes-systemwide.sh | 51 +++++ 11 files changed, 672 insertions(+), 43 deletions(-) create mode 100644 test/unittest/usdt/tst.stapsdt-notes-systemwide-isenabled.r create mode 100755 test/unittest/usdt/tst.stapsdt-notes-systemwide-isenabled.sh create mode 100755 test/unittest/usdt/tst.stapsdt-notes-systemwide-l.sh create mode 100644 test/unittest/usdt/tst.stapsdt-notes-systemwide-lib.r create mode 100755 test/unittest/usdt/tst.stapsdt-notes-systemwide-lib.sh create mode 100755 test/unittest/usdt/tst.stapsdt-notes-systemwide-lv.sh create mode 100644 test/unittest/usdt/tst.stapsdt-notes-systemwide.r create mode 100755 test/unittest/usdt/tst.stapsdt-notes-systemwide.sh -- 2.43.5