[DTrace-devel] [PATCH 00/17] USDT, phase 1

Nick Alcock nick.alcock at oracle.com
Wed Aug 10 22:06:52 UTC 2022


This patch series provides a minimal initial implementation of USDT. The
list of what it can't do is almost longer than the list of what it can: no
non-integral probe arguments and only a limited number of those, no globbing
of probe names, no omitting the provider name entirely (you can do it, but
USDT probes won't be discovered), no is-enabled probes, tracing of probes
near the start of main() is likely to be missed...

... but USDT probes do still work, even from DTrace v1-generated
probe-containing processes, and just like the old in-kernel implementation
probes are discovered even if their processes started long before DTrace
itself did (implemented via a systemwide daemon).  It needs CUSE and
libfuse, but sufficiently new ones (3.2+) are found in OL7 and OL8 (and I
think RHEL7 and RHEL8 as well) and I don't really care about distros older
than that :)

Much more on the implementation in the individual commit messages.


Untested: only one thing that I know of, the systemd unit file (I simply
haven't done a full make install for a long time). This is unlikely to be
too hard to test or fix, being about ten liones long :) but note that the
functioning of the systemwide daemon is only tested by a make check of an
installed testsuite package: in-tree make checks start a local daemon
instance and point DTrace at the local device node it created.

Nick Alcock (16):
  Revert "Remove drti.o and related support code."
  pid: drop dpp_stret
  runtest: make ZAPTHESE an array
  uapi headers: include <sys/dtrace_types> as needed
  dt_link: finish backing out varint, fixing dt_link-generated object
    files
  providers: allow providers with no trampoline
  port: add daemonization support code
  libproc: add Pinode_to_map()
  libproc: fix double-free on error path
  usdt: daemon
  drti: use /proc/self/maps
  fbt, syscall: use getline(), not fgets()
  dof: don't emit providers with no probes
  drti: emit into a subdirectory
  usdt: DTrace userspace side
  usdt: testsuite updates

David P. McLean (1):
  drti: reference first loaded segment of object containing
    dtrace_dof_init

 GNUmakefile                                   |    6 +-
 Makeconfig                                    |   28 +-
 Makefunctions                                 |    2 +-
 Makeoptions                                   |    8 +-
 dtprobed/60-dtprobed.rules                    |    1 +
 dtprobed/Build                                |   43 +
 dtprobed/dof_parser.c                         | 1104 +++++++++++++++++
 dtprobed/dof_parser.h                         |  142 +++
 dtprobed/dof_parser_host.c                    |  132 ++
 {libdtrace => dtprobed}/dt_list.c             |    0
 {libdtrace => dtprobed}/dt_list.h             |    0
 dtprobed/dtprobed.c                           |  620 +++++++++
 dtprobed/dtprobed.service                     |   16 +
 dtprobed/dtrace-usdt.target                   |    7 +
 dtprobed/rpl_fuse_log.c                       |   33 +
 dtprobed/rpl_fuse_log.h                       |   43 +
 dtprobed/uprobes.c                            |  302 +++++
 dtprobed/uprobes.h                            |   25 +
 dtrace.spec                                   |    6 +-
 include/dtrace/actions_defines.h              |    1 +
 include/dtrace/dof_defines.h                  |    1 +
 include/dtrace/pid.h                          |   24 +-
 include/port.h                                |   13 +-
 include/sys/sol_procfs.h                      |    6 +-
 libdtrace/Build                               |   39 +-
 libdtrace/drti-vers                           |    1 +
 libdtrace/drti.c                              |  220 ++++
 libdtrace/dt_bpf.c                            |    7 +
 libdtrace/dt_cg.c                             |    3 +-
 libdtrace/dt_dof.c                            |    3 +
 libdtrace/dt_link.c                           |   26 +-
 libdtrace/dt_pid.c                            |  345 ++++--
 libdtrace/dt_pid.h                            |    7 +-
 libdtrace/dt_prov_dtrace.c                    |   44 +-
 libdtrace/dt_prov_fbt.c                       |   20 +-
 libdtrace/dt_prov_pid.c                       |  343 +++--
 libdtrace/dt_prov_syscall.c                   |   20 +-
 libdtrace/dt_provider_tp.c                    |   12 +-
 libport/Build                                 |    2 +-
 libport/close_range.c                         |   81 ++
 libport/daemonize.c                           |  168 +++
 libproc/Build                                 |    4 +-
 libproc/Pcontrol.c                            |    2 +-
 libproc/Pcontrol.h                            |    1 +
 libproc/Psymtab.c                             |   84 +-
 libproc/libproc.h                             |    3 +
 runtest.sh                                    |   29 +-
 test/triggers/Build                           |   18 +-
 test/unittest/pid/tst.args1.d                 |    1 +
 test/unittest/pid/tst.ret1.d                  |    1 +
 test/unittest/pid/tst.ret2.d                  |    1 +
 test/unittest/usdt/tst.args-alt.d             |    2 +-
 test/unittest/usdt/tst.args.d                 |    1 -
 test/unittest/usdt/tst.dlclose1.sh            |    2 -
 test/unittest/usdt/tst.dlclose2.sh            |    3 +-
 test/unittest/usdt/tst.dlclose3.sh            |    2 +
 test/unittest/usdt/tst.dlclose3.x             |    1 -
 test/unittest/usdt/tst.eliminate.sh           |    2 +-
 test/unittest/usdt/tst.enable.d               |    2 +-
 test/unittest/usdt/tst.enable_and.d           |    2 +-
 test/unittest/usdt/tst.enable_and_2.d         |    2 +-
 test/unittest/usdt/tst.enable_or.d            |    2 +-
 test/unittest/usdt/tst.enable_or_2.d          |    2 +-
 test/unittest/usdt/tst.enable_return.d        |    2 +-
 test/unittest/usdt/tst.enable_stmt.d          |    2 +-
 test/unittest/usdt/tst.enabled.sh             |    2 +-
 test/unittest/usdt/tst.enabled2.sh            |    2 -
 test/unittest/usdt/tst.entryreturn.sh         |    2 +-
 test/unittest/usdt/tst.fork.sh                |    2 +-
 test/unittest/usdt/tst.guess32.sh             |    1 -
 test/unittest/usdt/tst.guess64.sh             |    1 -
 test/unittest/usdt/tst.lingering.r            |    8 +
 .../usdt/{tst.fork.sh => tst.lingering.sh}    |   44 +-
 test/unittest/usdt/tst.multiple.sh            |    1 -
 test/unittest/usdt/tst.reeval.sh              |    2 +-
 test/unittest/usdt/tst.static.sh              |    1 -
 test/unittest/usdt/tst.static2.sh             |    1 -
 test/unittest/usdt/tst.tailcall.d             |    4 +-
 test/utils/Build                              |    2 +-
 79 files changed, 3759 insertions(+), 389 deletions(-)
 create mode 100644 dtprobed/60-dtprobed.rules
 create mode 100644 dtprobed/Build
 create mode 100644 dtprobed/dof_parser.c
 create mode 100644 dtprobed/dof_parser.h
 create mode 100644 dtprobed/dof_parser_host.c
 rename {libdtrace => dtprobed}/dt_list.c (100%)
 rename {libdtrace => dtprobed}/dt_list.h (100%)
 create mode 100644 dtprobed/dtprobed.c
 create mode 100644 dtprobed/dtprobed.service
 create mode 100644 dtprobed/dtrace-usdt.target
 create mode 100644 dtprobed/rpl_fuse_log.c
 create mode 100644 dtprobed/rpl_fuse_log.h
 create mode 100644 dtprobed/uprobes.c
 create mode 100644 dtprobed/uprobes.h
 create mode 100644 libdtrace/drti-vers
 create mode 100644 libdtrace/drti.c
 create mode 100644 libport/close_range.c
 create mode 100644 libport/daemonize.c
 delete mode 120000 test/unittest/usdt/tst.dlclose3.x
 create mode 100644 test/unittest/usdt/tst.lingering.r
 copy test/unittest/usdt/{tst.fork.sh => tst.lingering.sh} (66%)

-- 
2.37.1.265.g363c192786.dirty




More information about the DTrace-devel mailing list