gentoo, manpage, and assorted other small fixes
v2 cover gentoo, manpage, and assorted other small fixes
Most of these are bugs reported by Gentoo, but their request for a dtprobed(8) manpage triggered a sweep of the dtrace manpage too, plus a fix to a rather unfortunate millisecs-versus-sedcs bug which caused us to wait for an hour and a half for a dtprobed parser child timeout rather than the intended five seconds.
The only potentially contentious ones are libsystemd (quite a lot of code, and not ours, but it's BSD-0-licensed and I took out the most ridiculously overkill parts), and the last two, which drop apparently redundant markup from the manpages whose purpose I'm not clear on but which seems to be ancient and is probably working around bugs in old Solaris troff or something. We can probably assume groff by this point, it's been the only maintained troff for decades.
Changes since v1:
Review comment adjustments, and replacement of the INT_MAX dt_probe_lookup2() fix with something rather more comprehensive
Many of these have already been reviewed and have a reviewed-by: I assume having the whole series reposted is nonetheless clearer (I can post only the non-reviewed-by:ed parts in future if you prefer).
Nick Alcock (14):
No longer depend on libsystemd
pkgconfig: drop spaces in variable decls configure, build: make valgrind optional
build: substitute LIBDIR in pkg-config files
probe: improve dt_probe_lookup2()
configure: fix dreadful behaviour of MANDIR / --mandir
man: the synopsis is ended with .YS, not .SY
man: use \- for option dashes, not -
man: drop blank lines
man: fix blank line in environment variables list
dtprobed: fix parser child timeout
man: add manpage for dtprobed(8)
man: drop double-\fB at the start of every option line
man: \fP-ize
GNUmakefile | 3 +- Makeconfig | 37 +++++++++- cmd/Build | 2 +- cmd/dtrace.8 | 151 ++++++++++++++++++++------------------- configure | 11 ++- dtprobed/Build | 9 +-- dtprobed/dtprobed.8 | 64 +++++++++++++++++ dtprobed/dtprobed.c | 10 +-- include/port.h | 1 + libdtrace/dt_impl.h | 2 + libdtrace/dt_probe.c | 44 ++++-------- libdtrace/dt_subr.c | 10 +++ libdtrace/dt_work.c | 16 ++++- libport/Build | 4 +- libport/systemd_notify.c | 70 ++++++++++++++++++ uts/Build | 1 + uts/dtrace.pc.in | 6 +- uts/dtrace_sdt.pc.in | 4 +- 18 files changed, 310 insertions(+), 135 deletions(-) create mode 100644 dtprobed/dtprobed.8 create mode 100644 libport/systemd_notify.c
base-commit: 8a1264bf0e818c8624be250eb5174714b62ed93c
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 1/14 No longer depend on libsystemd
We only need this for the systemd notification protocol, and that's so simple there is MIT-0-licensed reusable code in the sd_notify manpage showing you how to use it. That code looks pretty much OK, so I modified it lightly and pulled it into libport, with one tweak to remove the use of __attribute__((cleanup)) (it could be replaced by one line of perfectly trivial standard C code, saving five or six lines in all).
With libsystemd linkage gone, we need another way for the user to indicate that systemd is not in use and the systemd unit files are not wanted: so introduce a new --without-systemd (and corresponding --with-systemd=no, etc) in configure. (Someone directly running make can just pass WITH_SYSTEMD= to make.)
We lose one feature of libsystemd's sd_notify: we no longer remove the NOTIFY_SOCKET env var from the environment, so our children could in theory pretend to be us and notify systemd on our behalf. Since our only child is in a seccomped jail and is part of dtprobed anyway, this loss of functionality is purely theoretical.
--- GNUmakefile | 1 + Makeconfig | 1 - configure | 8 +++-- dtprobed/Build | 7 +--- dtprobed/dtprobed.c | 8 +---- include/port.h | 1 + libport/Build | 4 +-- libport/systemd_notify.c | 70 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 82 insertions(+), 18 deletions(-) create mode 100644 libport/systemd_notify.c
GNUmakefile +1 -0
@@ -102,6 +102,7 @@ PKGCONFIGDIR = $(prefix)/share/pkgconfig INSTPKGCONFIGDIR = $(DESTDIR)$(PKGCONFIGDIR) TESTDIR = $(LIBDIR)/dtrace/testsuite INSTTESTDIR = $(DESTDIR)$(TESTDIR) +WITH_SYSTEMD = y TARGETS = DTRACE ?= $(objdir)/dtrace
Makeconfig +0 -1
@@ -218,7 +218,6 @@ $(eval $(call check-symbol-rule,ELF_GETSHDRSTRNDX,elf_getshdrstrndx,elf)) $(eval $(call check-symbol-rule,LIBCTF,ctf_open,ctf,t)) $(eval $(call check-symbol-rule,STRRSTR,strrstr,c)) $(eval $(call check-symbol-rule,PTHREAD_ATFORK,pthread_atfork,c)) -$(eval $(call check-symbol-rule,LIBSYSTEMD,sd_notify,systemd,t)) ifndef WANTS_LIBFUSE2 $(eval $(call check-symbol-rule,FUSE_LOG,fuse_set_log_func,fuse3)) $(eval $(call check-symbol-rule,LIBFUSE3,fuse_session_receive_buf,fuse3,t))
configure +6 -2
@@ -93,9 +93,13 @@ built locally, none of these should be needed): EOF make help-overrides-header help-overrides-option + cat >&2 <<'EOF' +--with-systemd=[yes/no] Install the systemd unit files (default: yes) +EOF echo >&2 make help-overrides cat >&2 <<'EOF' + Options controlling the compiler (pass on the command line): CC C compiler (may be a cross-compiler)
@@ -153,12 +157,12 @@ for option in "$@"; do --kernel-obj-dir=*) write_make_var KERNELOBJDIR "$option";; --kernel-src-suffix=*) write_make_var KERNELSRCNAME "$option";; --kernel-obj-suffix=*) write_make_var KERNELBLDNAME "$option";; + --with-systemd|--with-systemd=y*) write_make_var WITH_SYSTEMD "y";; + --with-systemd=n*|--without-systemd) write_make_var WITH_SYSTEMD "";; HAVE_ELF_GETSHDRSTRNDX=*) write_config_var ELF_GETSHDRSTRNDX "$option";; --with-libctf=*) write_config_var LIBCTF "$option";; HAVE_LIBCTF=*) write_config_var LIBCTF "$option";; HAVE_STRRSTR=*) write_config_var STRRSTR "$option";; - --with-libsystemd=*) write_config_var LIBSYSTEMD "$option";; - HAVE_LIBSYSTEMD=*) write_config_var LIBSYSTEMD "$option";; HAVE_FUSE_LOG=*) write_config_var FUSE_LOG "$option";; --with-libfuse3=*) write_config_var LIBFUSE3 "$option";; HAVE_LIBFUSE3=*) write_config_var LIBFUSE3 "$option";;
dtprobed/Build +1 -6
@@ -29,11 +29,6 @@ dtprobed_DEPS := libproc.a libcommon.a libport.a dtprobed_SOURCES := dtprobed.c dof_stash.c seccomp-assistance.c dtprobed_LIBSOURCES := libproc libcommon -ifdef HAVE_LIBSYSTEMD -dtprobed_CFLAGS += $(shell pkg-config --cflags libsystemd) -dtprobed_LIBS += $(shell pkg-config --libs libsystemd) -endif - ifndef HAVE_FUSE_LOG dtprobed_SOURCES += rpl_fuse_log.c endif
@@ -43,7 +38,7 @@ seccomp-assistance.c_CFLAGS := -fno-lto endif install-dtprobed-autostart:: -ifdef HAVE_LIBSYSTEMD +ifneq ($(WITH_SYSTEMD),) mkdir -p $(INSTSYSTEMDUNITDIR) $(INSTSYSTEMDPRESETDIR) $(call describe-install-target,$(INSTSYSTEMDUNITDIR),dtprobed.service) sed 's,@SBINDIR@,$(SBINDIR),' < $(dtprobed_DIR)dtprobed.service.in > $(INSTSYSTEMDUNITDIR)/dtprobed.service
dtprobed/dtprobed.c +1 -7
@@ -61,10 +61,6 @@#include <dtrace/ioctl.h> -#ifdef HAVE_LIBSYSTEMD -#include <systemd/sd-daemon.h> -#endif -#include <dt_list.h> #include "dof_parser.h" #include "dof_stash.h"
@@ -1073,9 +1069,7 @@ main(int argc, char *argv[]) sync_fd =-1 ; } -#ifdef HAVE_LIBSYSTEMD -sd_notify (1 ,"READY=1" ); -#endif +systemd_notify ("READY=1" ); ret =loop ();
include/port.h +1 -0
@@ -29,6 +29,7 @@ int p_online(int cpun);#define MUTEX_HELD (x) ((x)->__data.__count == 0)int daemonize (int close_fds); +int systemd_notify (const char *message); _dt_noreturn_ void daemon_perr(int fd, const char *err, int err_no); _dt_printflike_(2, 3) void daemon_log(int fd, const char *fmt, ...);
libport/Build +2 -2
@@ -1,5 +1,5 @@ # Oracle Linux DTrace. -# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl.
@@ -8,7 +8,7 @@ LIBS += libport libport_TARGET = libport libport_DIR := $(current-dir) -libport_SOURCES = gmatch.c linux_version_code.c strlcat.c strlcpy.c p_online.c time.c daemonize.c +libport_SOURCES = gmatch.c linux_version_code.c strlcat.c strlcpy.c p_online.c time.c daemonize.c systemd_notify.c ifndef HAVE_CLOSE_RANGE libport_SOURCES += close_range.c endif
libport/systemd_notify.c new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.46.0.278.g36e3a12567
Re: [PATCH v2 01/14] No longer depend on libsystemd
You are your own enemy :) Since you chose to use all spaces for indentation in your configure script, you now introduced inconsistency by adding lines with tabs! See below...
Quoted 62 lines · Nick Alcock
We only need this for the systemd notification protocol, and that's so simple there is MIT-0-licensed reusable code in the
sd_notifymanpage showing you how to use it. That code looks pretty much OK, so I modified it lightly and pulled it into libport, with one tweak to remove the use of __attribute__((cleanup)) (it could be replaced by one line of perfectly trivial standard C code, saving five or six lines in all).With libsystemd linkage gone, we need another way for the user to indicate that systemd is not in use and the systemd unit files are not wanted: so introduce a new --without-systemd (and corresponding --with-systemd=no, etc) in configure. (Someone directly running make can just pass WITH_SYSTEMD= to make.)
We lose one feature of libsystemd's
sd_notify: we no longer remove theNOTIFY_SOCKETenv var from the environment, so our children could in theory pretend to be us and notify systemd on our behalf. Since our only child is in a seccomped jail and is part of dtprobed anyway, this loss of functionality is purely theoretical.--- GNUmakefile | 1 + Makeconfig | 1 - configure | 8 +++-- dtprobed/Build | 7 +--- dtprobed/dtprobed.c | 8 +---- include/port.h | 1 + libport/Build | 4 +-- libport/systemd_notify.c | 70 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 82 insertions(+), 18 deletions(-) create mode 100644 libport/systemd_notify.cGNUmakefile +1
-0@@ -102,6 +102,7 @@ PKGCONFIGDIR = $(prefix)/share/pkgconfig INSTPKGCONFIGDIR = $(DESTDIR)$(PKGCONFIGDIR) TESTDIR = $(LIBDIR)/dtrace/testsuite INSTTESTDIR = $(DESTDIR)$(TESTDIR) +WITH_SYSTEMD = y TARGETS = DTRACE ?= $(objdir)/dtraceMakeconfig +0
-1@@ -218,7 +218,6 @@ $(eval $(call check-symbol-rule,ELF_GETSHDRSTRNDX,elf_getshdrstrndx,elf)) $(eval $(call check-symbol-rule,LIBCTF,ctf_open,ctf,t)) $(eval $(call check-symbol-rule,STRRSTR,strrstr,c)) $(eval $(call check-symbol-rule,PTHREAD_ATFORK,pthread_atfork,c)) -$(eval $(call check-symbol-rule,LIBSYSTEMD,sd_notify,systemd,t)) ifndef WANTS_LIBFUSE2 $(eval $(call check-symbol-rule,FUSE_LOG,fuse_set_log_func,fuse3)) $(eval $(call check-symbol-rule,LIBFUSE3,fuse_session_receive_buf,fuse3,t))configure +0
-0
configure built locally, none of these should be needed): · line 96
Quoted 4 lines
configure +1
-0@@ -93,9 +93,13 @@ built locally, none of these should be needed): EOF make help-overrides-header help-overrides-option + cat >&2 <<'EOF'
Leading tab whereas all other lines use spaces.
Quoted 186 lines
configure +5
-2+--with-systemd=[yes/no] Install the systemd unit files (default: yes) +EOF echo >&2 make help-overrides cat >&2 <<'EOF' + Options controlling the compiler (pass on the command line): CC C compiler (may be a cross-compiler)@@ -153,12 +157,12 @@ for option in "$@"; do --kernel-obj-dir=*) write_make_var KERNELOBJDIR "$option";; --kernel-src-suffix=*) write_make_var KERNELSRCNAME "$option";; --kernel-obj-suffix=*) write_make_var KERNELBLDNAME "$option";; + --with-systemd|--with-systemd=y*) write_make_var WITH_SYSTEMD "y";; + --with-systemd=n*|--without-systemd) write_make_var WITH_SYSTEMD "";; HAVE_ELF_GETSHDRSTRNDX=*) write_config_var ELF_GETSHDRSTRNDX "$option";; --with-libctf=*) write_config_var LIBCTF "$option";; HAVE_LIBCTF=*) write_config_var LIBCTF "$option";; HAVE_STRRSTR=*) write_config_var STRRSTR "$option";; - --with-libsystemd=*) write_config_var LIBSYSTEMD "$option";; - HAVE_LIBSYSTEMD=*) write_config_var LIBSYSTEMD "$option";; HAVE_FUSE_LOG=*) write_config_var FUSE_LOG "$option";; --with-libfuse3=*) write_config_var LIBFUSE3 "$option";; HAVE_LIBFUSE3=*) write_config_var LIBFUSE3 "$option";;dtprobed/Build +1
-6@@ -29,11 +29,6 @@ dtprobed_DEPS := libproc.a libcommon.a libport.a dtprobed_SOURCES := dtprobed.c dof_stash.c seccomp-assistance.c dtprobed_LIBSOURCES := libproc libcommon -ifdef HAVE_LIBSYSTEMD -dtprobed_CFLAGS += $(shell pkg-config --cflags libsystemd) -dtprobed_LIBS += $(shell pkg-config --libs libsystemd) -endif - ifndef HAVE_FUSE_LOG dtprobed_SOURCES += rpl_fuse_log.c endif@@ -43,7 +38,7 @@ seccomp-assistance.c_CFLAGS := -fno-lto endif install-dtprobed-autostart:: -ifdef HAVE_LIBSYSTEMD +ifneq ($(WITH_SYSTEMD),) mkdir -p $(INSTSYSTEMDUNITDIR) $(INSTSYSTEMDPRESETDIR) $(call describe-install-target,$(INSTSYSTEMDUNITDIR),dtprobed.service) sed 's,@SBINDIR@,$(SBINDIR),' < $(dtprobed_DIR)dtprobed.service.in > $(INSTSYSTEMDUNITDIR)/dtprobed.servicedtprobed/dtprobed.c +1
-7@@ -61,10 +61,6 @@#include <dtrace/ioctl.h> -#ifdef HAVE_LIBSYSTEMD -#include <systemd/sd-daemon.h> -#endif -#include <dt_list.h> #include "dof_parser.h" #include "dof_stash.h" @@ -1073,9 +1069,7 @@ main(int argc, char *argv[]) sync_fd =-1 ; } -#ifdef HAVE_LIBSYSTEMD -sd_notify (1 ,"READY=1" ); -#endif +systemd_notify ("READY=1" ); ret =loop ();include/port.h +1
-0@@ -29,6 +29,7 @@ int p_online(int cpun);#define MUTEX_HELD (x) ((x)->__data.__count == 0)int daemonize (int close_fds); +int systemd_notify (const char *message); _dt_noreturn_ void daemon_perr(int fd, const char *err, int err_no); _dt_printflike_(2, 3) void daemon_log(int fd, const char *fmt, ...);libport/Build +2
-2@@ -1,5 +1,5 @@ # Oracle Linux DTrace. -# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl.@@ -8,7 +8,7 @@ LIBS += libport libport_TARGET = libport libport_DIR := $(current-dir) -libport_SOURCES = gmatch.c linux_version_code.c strlcat.c strlcpy.c p_online.c time.c daemonize.c +libport_SOURCES = gmatch.c linux_version_code.c strlcat.c strlcpy.c p_online.c time.c daemonize.c systemd_notify.c ifndef HAVE_CLOSE_RANGE libport_SOURCES += close_range.c endiflibport/systemd_notify.c new file +70
-0@@ -0,0 +1,70 @@ +/* SPDX-License-Identifier: MIT-0 */ +/* Lightly modified from the sd_notify manpage. */ + +#include <sys/socket.h> +#include <sys/un.h> +#include <errno.h> +#include <stdlib.h> +#include <stddef.h> +#include <string.h> +#include <unistd.h> + +int +systemd_notify (const char *message) +{ +union sockaddr_union { +struct sockaddr sa; +struct sockaddr_un sun; + } socket_addr = { + .sun.sun_family =AF_UNIX , + }; + +size_t path_length, message_length; +int fd =-1 ; +const char *socket_path; + +/* Verify the argument first */ +if (!message) +return -EINVAL ; + + message_length =strlen (message); +if (message_length ==0 ) +return -EINVAL ; + +/* If the variable is not set, the protocol is a noop */ + socket_path =getenv ("NOTIFY_SOCKET" ); +if (!socket_path) +return 0 ;/* Not set? Nothing to do */ + +/* Only AF_UNIX is supported, with path or abstract sockets */ +if (socket_path[0 ] !='/' && socket_path[0 ] !='@' ) +return -EAFNOSUPPORT ; + + path_length =strlen (socket_path); +/* Ensure there is room for NUL byte */ +if (path_length >=sizeof (socket_addr.sun.sun_path)) +return -E2BIG ; + +memcpy (socket_addr.sun.sun_path, socket_path, path_length); + +/* Support for abstract socket */ +if (socket_addr.sun.sun_path[0 ] =='@' ) + socket_addr.sun.sun_path[0 ] =0 ; + + fd =socket (AF_UNIX ,SOCK_DGRAM |SOCK_CLOEXEC ,0 ); +if (fd <0 ) +return -errno; + +if (connect (fd, &socket_addr.sa, offsetof(struct sockaddr_un , sun_path) + path_length) !=0 ) { +close (fd); +return -errno; + } + +ssize_t written =write (fd, message, message_length); +if (written != (ssize_t ) message_length) { +close (fd); +return written <0 ? -errno : -EPROTO ; + } + +return 1 ;/* Notified! */ +}Signature · 1 line
2.46.0.278.g36e3a12567
Re: [PATCH v2 01/14] No longer depend on libsystemd
On 29 Oct 2024, Kris Van Hees told this:
Quoted 3 lines
You are your own enemy :) Since you chose to use all spaces for indentation in your configure script, you now introduced inconsistency by adding lines with tabs! See below...
AUGH
Maybe I should just arrange for my emacs to just fight itself all day long.
(Of course git log --check can't simultaneously diagnose this and the opposite problem...)
Quoted 7 lines · Nick Alcock
Quoted 6 lines
configure +0
-0@@ -93,9 +93,13 @@ built locally, none of these should be needed):
Quoted 5 lines
configure built locally, none of these should be needed): · line 96
Quoted 3 lines
configure +1
-0EOF make help-overrides-header help-overrides-option + cat >&2 <<'EOF'Leading tab whereas all other lines use spaces.
An audit reveals several such lines, actually (not all introduced by this patch, though most were). Fixed the lot because why not. This means we have a few extra "spurious" whitespace changes in this patch now, e.g.
- --prefix=*) write_make_var prefix "$option";;
+ --prefix=*) write_make_var prefix "$option";;
but only a very few.
Signature · 1 line
NULL && (void)
PATCH v2 2/14 pkgconfig: drop spaces in variable decls
In reply to Nick AlcockThe requirement to have variable declarations with no spaces in them is not documented, nor does pkg-config seem to care, but most pkg-config scripts in the wild conform to it and pkgconf --validate complains.
(pkgconf --validate may also complain about the Version lines. This is a bug in pkgconf, <https://todo.sr.ht/~kaniini/pkgconf/15>, and should be ignored.)
--- uts/dtrace.pc.in | 6 +++--- uts/dtrace_sdt.pc.in | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
uts/dtrace.pc.in +3 -3
@@ -1,6 +1,6 @@ -includedir = @INCLUDEDIR@ -libdir = @LIBDIR@ -dtrace = @DTRACE@ +includedir=@INCLUDEDIR@ +libdir=@LIBDIR@ +dtrace=@DTRACE@ Name: DTrace Description: DTrace consumer headers
uts/dtrace_sdt.pc.in +2 -2
@@ -1,5 +1,5 @@ -sdtincludedir = @SDTINCLUDEDIR@ -dtrace = @DTRACE@ +sdtincludedir=@SDTINCLUDEDIR@ +dtrace=@DTRACE@ Name: DTrace SDT Description: DTrace raw SDT headers
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 3/14 configure, build: make valgrind optional
In reply to Nick AlcockWe fail building if <valgrind/valgrind.h> is not available, which is ridiculous given that the only reason we need it is to make valgrind go away at suitable moments to let us drop uprobes.
A suitable new configure check (using a new check-header-macro-rule function) lets us check for <valgrind/valgrind.h> and disable it if not
present: as usual, defining HAVE_VALGRIND or passing it to configure will also suffice to override the check.
--- Makeconfig | 36 ++++++++++++++++++++++++++++++++++++ configure | 1 + libdtrace/dt_work.c | 16 ++++++++++++++-- 3 files changed, 51 insertions(+), 2 deletions(-)
Makeconfig +36 -0
@@ -163,6 +163,41 @@ $(CONFIG_H): $(objdir)/.config/config.$(1).h $(CONFIG_MK): $(objdir)/.config/config.$(1).mk endef +# Generate a makefile rule to check for the presence of MACRO +# in HEADER and emit an appropriate header file fragment into a file +# under $(objdir)/.config. +# +# The first argument must be suitable for a filename fragment, +# for a makefile rule name and for a #define. +# +# Syntax: $(call check-header-macro-rule,name,macro,header) +define check-header-macro-rule +$(objdir)/.config/config.$(1).h $(objdir)/.config/config.$(1).mk: $(objdir)/.config/.dir.stamp + case x$(HAVE_$(1)) in \ + xyes) echo '#define HAVE_$(1) 1' > $(objdir)/.config/config.$(1).h; \ + echo 'HAVE_$(1)=y' > $(objdir)/.config/config.$(1).mk;; \ + xno) echo '/* #undef HAVE_$(1) */' > $(objdir)/.config/config.$(1).h; \ + echo '# HAVE_$(1) undefined' > $(objdir)/.config/config.$(1).mk;; \ + *) if printf '#include <%s.h>\n#ifndef %s\n#error %s not found.\n#endif' "$(3)" "$(2)" "$(2)" | \ + $(CC) $(filter-out --coverage,$(CFLAGS) $(LDFLAGS)) -Iinclude -D_GNU_SOURCE -Werror=implicit-function-declaration -c -o /dev/null -x c - >/dev/null 2>&1; then \ + echo '#define HAVE_$(1) 1' > $(objdir)/.config/config.$(1).h; \ + echo 'HAVE_$(1)=y' > $(objdir)/.config/config.$(1).mk; \ + else \ + echo '/* #undef HAVE_$(1) */' > $(objdir)/.config/config.$(1).h; \ + echo '# HAVE_$(1) undefined' > $(objdir)/.config/config.$(1).mk; \ + fi;; \ + *) echo "HAVE_$(1) must be yes or no, not $(HAVE_$(1))" >&2; \ + false;; \ + esac + rm -f $(CONFIG_H) + rm -f $(CONFIG_MK) + +$(eval $(call make-override-help,HAVE_$(1), presence of preprocessor macro $(2) in $(3).h)) + +$(CONFIG_H): $(objdir)/.config/config.$(1).h +$(CONFIG_MK): $(objdir)/.config/config.$(1).mk +endef + # Generate a makefile rule to check for support for OPTION in BPFC and emit an # appropriate header file fragment into a file under $(objdir)/.config. #
@@ -229,6 +264,7 @@ $(eval $(call check-header-rule,DIS1,disassembler(NULL),disasm)) $(eval $(call check-header-rule,DIS4,disassembler(0,0,0,NULL),disasm)) $(eval $(call check-header-rule,INITDISINFO3,init_disassemble_info(NULL,NULL,NULL),disasm)) $(eval $(call check-header-rule,INITDISINFO4,init_disassemble_info(NULL,NULL,NULL,NULL),disasm)) +$(eval $(call check-header-macro-rule,VALGRIND,VALGRIND_NON_SIMD_CALL0,valgrind/valgrind)) $(eval $(call check-bpfc-option-rule,BPFV3,-mcpu=v3)) $(eval $(call check-bpfc-option-rule,BPFMASM,-masm=normal))
configure +1 -0
@@ -169,6 +169,7 @@ for option in "$@"; do HAVE_FUSE_NUMA=*) write_config_var FUSE_NUMA "$option";; HAVE_CLOSE_RANGE=*) write_config_var CLOSE_RANGE "$option";; HAVE_GETTID=*) write_config_var GETTID "$option";; + HAVE_VALGRIND=*) write_config_var VALGRIND "$option";; HAVE_BPFV3=*) write_config_var BPFV3 "$option";; HAVE_BPFMASM=*) write_config_var BPFMASM "$option";; *) echo "Unknown option $option" >&2
libdtrace/dt_work.c +14 -2
@@ -13,7 +13,9 @@#include <port.h> #include <linux/perf_event.h> #include <sys/epoll.h> +#ifdef HAVE_VALGRIND #include <valgrind/valgrind.h> +#endif #include <dt_impl.h> #include <dt_aggregate.h> #include <dt_peb.h>
@@ -187,9 +189,11 @@ beginend_child(void *arg) {read (args->tochild[0 ], &cmd,sizeof (cmd));if (cmd !=CMD_BEGIN )exit (1 ); +#ifdef HAVE_VALGRIND if (RUNNING_ON_VALGRIND )VALGRIND_NON_SIMD_CALL0 (BEGIN_probe); else +#endif BEGIN_probe (); cmd++;write (args->frchild[1 ], &cmd,sizeof (cmd));
@@ -198,9 +202,11 @@ beginend_child(void *arg) {read (args->tochild[0 ], &cmd,sizeof (cmd));if (cmd !=CMD_END )exit (1 ); +#ifdef HAVE_VALGRIND if (RUNNING_ON_VALGRIND )VALGRIND_NON_SIMD_CALL0 (END_probe); else +#endif END_probe (); cmd++;write (args->frchild[1 ], &cmd,sizeof (cmd));
@@ -300,9 +306,12 @@ dtrace_go(dtrace_hdl_t *dtp, uint_t cflags) }if (cmd !=CMD_BEGIN +1 )return -1 ; - }else if (RUNNING_ON_VALGRIND ) + } +#ifdef HAVE_VALGRIND + else if (RUNNING_ON_VALGRIND) VALGRIND_NON_SIMD_CALL0(BEGIN_probe); else +#endif BEGIN_probe(); dtp->dt_active = 1;
@@ -344,9 +353,12 @@ dtrace_stop(dtrace_hdl_t *dtp)return -1 ;pthread_join (args->thr,NULL );dt_free (dtp, args); - }else if (RUNNING_ON_VALGRIND ) + } +#ifdef HAVE_VALGRIND + else if (RUNNING_ON_VALGRIND) VALGRIND_NON_SIMD_CALL0(END_probe); else +#endif END_probe(); dtp->dt_stopped = 1;
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 4/14 build: substitute LIBDIR in pkg-config files
In reply to Nick Alcock/usr/share/pkgconfig/dtrace.pc says
libdir = @LIBDIR@
/* ... */
Libs: -L${libdir} -ldtrace
which is unlikely to work.
Fix by substituting LIBDIR properly.
(I looked at these pkg-config files after installation I don't know how many times and never once spotted this incredibly obvious problem.)
--- uts/Build | 1 + 1 file changed, 1 insertion(+)
uts/Build +1 -0
@@ -37,6 +37,7 @@ install:: (cd $(uts_DIR) && \ sed -e 's,@SDTINCLUDEDIR@,$(SDTINCLUDEDIR),g;' \ -e 's,@INCLUDEDIR@,$(INCLUDEDIR),g;' \ + -e 's,@LIBDIR@,$(LIBDIR),g;' \ -e 's,@VERSION@,$(VERSION),g;' \ -e 's,@DTRACE@,$(SBINDIR)/dtrace,g' < \ $${name}.in > $(INSTPKGCONFIGDIR)/$$name;) \
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 5/14 probe: improve dt_probe_lookup2()
In reply to Nick AlcockThis function had numerous problems:
- it broke _FORTIFY_SOURCE due to using a function that snprintf()ed with a size of INT_MAX, into a much smaller alloca()ed buffer
- it claimed to call down to the dtrace kernel module for a probe description (long obsolete)
- it invariably leaked the probe description it constructed by calling dtrace_xstr2desc()
- it did meaningless errno testing to determine whether to return EDT_NOPROBE on error, which more or less led to EDT_NOPROBE never being returned even though it should always be in this case (there is no other cause for the ID hash lookup failing).
Fix the lot: while we're at it, implement a dt_desc_destroy() to undo the strdup()s done by dtrace_xstr2desc(), and use it additionally in dt_probe_destroy() instead of an identical sequence of dt_free()s.
--- libdtrace/dt_impl.h | 2 ++ libdtrace/dt_probe.c | 44 +++++++++++++------------------------------- libdtrace/dt_subr.c | 10 ++++++++++ 3 files changed, 25 insertions(+), 31 deletions(-)
libdtrace/dt_impl.h +2 -0
@@ -759,6 +759,8 @@ extern dtrace_difo_t *dt_difo_copy(dtrace_hdl_t *dtp, const dtrace_difo_t *odp);extern int dt_consume_init (dtrace_hdl_t *);extern void dt_consume_fini (dtrace_hdl_t *); +extern void dt_desc_destroy (dtrace_hdl_t *dtp,dtrace_probedesc_t *); +extern dtrace_datadesc_t *dt_datadesc_hold (dtrace_datadesc_t *ddp);extern void dt_datadesc_release (dtrace_hdl_t *,dtrace_datadesc_t *);extern dtrace_datadesc_t *dt_datadesc_create (dtrace_hdl_t *);
libdtrace/dt_probe.c +13 -31
75 lines not on this page · raw message
libdtrace/dt_subr.c +10 -0
@@ -175,6 +175,16 @@ dtrace_desc2str(const dtrace_probedesc_t *pdp, char *buf, size_t len)return buf; } +/* Only use on probedescs derived from dtrace_xstr2desc above. */ +void +dt_desc_destroy (dtrace_hdl_t *dtp,dtrace_probedesc_t *pdp) +{ +dt_free (dtp, (void *) pdp->prv); +dt_free (dtp, (void *) pdp->mod); +dt_free (dtp, (void *) pdp->fun); +dt_free (dtp, (void *) pdp->prb); +} +char *dtrace_attr2str (dtrace_attribute_t attr,char *buf,size_t len) {
Signature · 1 line
2.46.0.278.g36e3a12567
Re: [DTrace-devel] [PATCH v2 05/14] probe: improve dt_probe_lookup2()
Quoted 30 lines · Nick Alcock via DTrace-devel
This function had numerous problems:
- it broke
_FORTIFY_SOURCEdue to using a function that snprintf()ed with a size ofINT_MAX, into a much smaller alloca()ed buffer
- it claimed to call down to the dtrace kernel module for a probe description (long obsolete)
- it invariably leaked the probe description it constructed by callingdtrace_xstr2desc()
- it did meaningless errno testing to determine whether to returnEDT_NOPROBEon error, which more or less led toEDT_NOPROBEnever being returned even though it should always be in this case (there is no other cause for the ID hash lookup failing).Fix the lot: while we're at it, implement a
dt_desc_destroy()to undo the strdup()s done bydtrace_xstr2desc(), and use it additionally indt_probe_destroy()instead of an identical sequence of dt_free()s.--- libdtrace/dt_impl.h | 2 ++ libdtrace/dt_probe.c | 44 +++++++++++++------------------------------- libdtrace/dt_subr.c | 10 ++++++++++ 3 files changed, 25 insertions(+), 31 deletions(-)libdtrace/dt_impl.h +0
-0
libdtrace/dt_impl.h extern dtrace_difo_t *dt_difo_copy(dtrace_hdl_t *dtp, const dtrace_difo_t *odp); · line 762
Quoted 4 lines
libdtrace/dt_impl.h +1
-0@@ -759,6 +759,8 @@ extern dtrace_difo_t *dt_difo_copy(dtrace_hdl_t *dtp, const dtrace_difo_t *odp);extern int dt_consume_init (dtrace_hdl_t *);extern void dt_consume_fini (dtrace_hdl_t *); +extern void dt_desc_destroy (dtrace_hdl_t *dtp,dtrace_probedesc_t *);
I think it would be better to let dt_desc_destroy() take a third arg, to indicate whether the desc itself should be free'd as well or whether it should be left alone.
That avoids calling it and then following it up with a dt_free() on the desc.
Quoted 91 lines
libdtrace/dt_impl.h +1
-0+extern dtrace_datadesc_t *dt_datadesc_hold (dtrace_datadesc_t *ddp);extern void dt_datadesc_release (dtrace_hdl_t *,dtrace_datadesc_t *);extern dtrace_datadesc_t *dt_datadesc_create (dtrace_hdl_t *);libdtrace/dt_probe.c +13
-31@@ -172,24 +172,9 @@ dt_probe_alloc_args(dt_probe_t *prp, int nargc, int xargc) } } -static size_t -dt_probe_keylen (const dtrace_probedesc_t *pdp) -{ -return strlen (pdp->mod) +1 +strlen (pdp->fun) +1 + -strlen (pdp->prb) +1 ; -} - -static char * -dt_probe_key (const dtrace_probedesc_t *pdp,char *s) -{ -snprintf (s,INT_MAX ,"%s:%s:%s" , pdp->mod, pdp->fun, pdp->prb); -return s; -} -/* * Lookup a probe declaration based on a known provider and full or partially -* specified module, function, and name. If the probe is not known to us yet, -* ask dtrace(7D) to match the description and then cache any useful results. +* specified module, function, and name. */ dt_probe_t *dt_probe_lookup2 (dt_provider_t *pvp,const char *s)@@ -197,28 +182,28 @@ dt_probe_lookup2(dt_provider_t *pvp, const char *s)dtrace_hdl_t *dtp = pvp->pv_hdl;dtrace_probedesc_t pd;dt_ident_t *idp; -size_t keylen;char *key;if (dtrace_str2desc (dtp,DTRACE_PROBESPEC_NAME , s, &pd) !=0 )return NULL ;/* dt_errno is set for us */ - keylen =dt_probe_keylen (&pd); - key =dt_probe_key (&pd,alloca (keylen)); +if (asprintf (&key,"%s:%s:%s" , pd.mod, pd.fun, pd.prb) ==-1 ) { +dt_set_errno (dtp, errno); + goto out; + }/* * If the probe is already declared, then return the dt_probe_t from -* the existing identifier. This could come from a static declaration -* or it could have been cached from an earlier call to this function. +* the existing identifier. */ -if ((idp =dt_idhash_lookup (pvp->pv_probes, key)) !=NULL ) +if ((idp =dt_idhash_lookup (pvp->pv_probes, key)) !=NULL ) { +dt_desc_destroy (dtp, &pd);return idp->di_data; + } -if (errno ==ESRCH || errno ==EBADF ) -dt_set_errno (dtp,EDT_NOPROBE ); -else -dt_set_errno (dtp, errno); - +dt_set_errno (dtp,EDT_NOPROBE ); + out: +dt_desc_destroy (dtp, &pd);return NULL ; }@@ -387,10 +372,7 @@ dt_probe_destroy(dt_probe_t *prp)dt_free (dtp, prp->mapping);dt_free (dtp, prp->argv);if (prp->desc) { -dt_free (dtp, (void *)prp->desc->prv); -dt_free (dtp, (void *)prp->desc->mod); -dt_free (dtp, (void *)prp->desc->fun); -dt_free (dtp, (void *)prp->desc->prb); +dt_desc_destroy (dtp, (dtrace_probedesc_t *)prp->desc);dt_free (dtp, (void *)prp->desc); }dt_free (dtp, prp);libdtrace/dt_subr.c +0
-0
libdtrace/dt_subr.c dtrace_desc2str(const dtrace_probedesc_t *pdp, char *buf, size_t len) · line 178
Quoted 4 lines
libdtrace/dt_subr.c +1
-0@@ -175,6 +175,16 @@ dtrace_desc2str(const dtrace_probedesc_t *pdp, char *buf, size_t len)return buf; } +/* Only use on probedescs derived from dtrace_xstr2desc above. */
Why can't it used on other dtrace_probedesc_t that contain references to memory that needs to be free'd? I don't think that dtrace_xstr2desc() does anything to make the desc it populates be special.
Quoted 20 lines
libdtrace/dt_subr.c +9
-0+void +dt_desc_destroy (dtrace_hdl_t *dtp,dtrace_probedesc_t *pdp) +{ +dt_free (dtp, (void *) pdp->prv); +dt_free (dtp, (void *) pdp->mod); +dt_free (dtp, (void *) pdp->fun); +dt_free (dtp, (void *) pdp->prb); +} +char *dtrace_attr2str (dtrace_attribute_t attr,char *buf,size_t len) {Signature · 7 lines
2.46.0.278.g36e3a12567 _______________________________________________ DTrace-devel mailing list [email protected] https://oss.oracle.com/mailman/listinfo/dtrace-devel
Re: [DTrace-devel] [PATCH v2 05/14] probe: improve dt_probe_lookup2()
On 29 Oct 2024, Kris Van Hees outgrape:
Quoted 9 lines · Nick Alcock via DTrace-devel
Quoted 8 lines
libdtrace/dt_impl.h +0
-0@@ -759,6 +759,8 @@ extern dtrace_difo_t *dt_difo_copy(dtrace_hdl_t *dtp, const dtrace_difo_t *odp);extern int dt_consume_init (dtrace_hdl_t *);extern void dt_consume_fini (dtrace_hdl_t *);
Quoted 7 lines
libdtrace/dt_impl.h extern dtrace_difo_t *dt_difo_copy(dtrace_hdl_t *dtp, const dtrace_difo_t *odp); · line 762
Quoted 1 line
libdtrace/dt_impl.h +1
-0+extern void dt_desc_destroy (dtrace_hdl_t *dtp,dtrace_probedesc_t *);I think it would be better to let
dt_desc_destroy()take a third arg, to indicate whether the desc itself should be free'd as well or whether it should be left alone.That avoids calling it and then following it up with a
dt_free()on the desc.
... er, OK? Is that really clearer than the alternative?
Implemented, anyway (and made it return straight away if called with a NULL pdp, for consistency with free(), which lets us drop a conditional as well).
Quoted 8 lines
Quoted 8 lines
libdtrace/dt_subr.c +0
-0@@ -175,6 +175,16 @@ dtrace_desc2str(const dtrace_probedesc_t *pdp, char *buf, size_t len)return buf; }
Quoted 5 lines
libdtrace/dt_subr.c dtrace_desc2str(const dtrace_probedesc_t *pdp, char *buf, size_t len) · line 178
Quoted 1 line
libdtrace/dt_subr.c +1
-0+/* Only use on probedescs derived from dtrace_xstr2desc above. */ Why can't it used on other
dtrace_probedesc_tthat contain references to memory that needs to be free'd? I don't think thatdtrace_xstr2desc()does anything to make the desc it populates be special.
I'm a bit worried that some of them might be using pointers to regions within storage owned by someone else rather than strdup()s (I mean they *are* const, and that's what that generally means). If that's not true, why are the pointers const?
Signature · 1 line
NULL && (void)
PATCH v2 6/14 configure: fix dreadful behaviour of MANDIR / --mandir
In reply to Nick AlcockThis should obviously refer to the top-level mandir, i.e. PREFIX/share/man, not PREFIX/share/man/man8! Literally no package ever does that, I don't know what I was thinking...
--- GNUmakefile | 2 +- cmd/Build | 2 +- configure | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
GNUmakefile +1 -1
@@ -96,7 +96,7 @@ INSTSYSTEMDPRESETDIR = $(DESTDIR)$(SYSTEMDPRESETDIR) INSTSYSTEMDUNITDIR = $(DESTDIR)$(SYSTEMDUNITDIR) DOCDIR = $(prefix)/share/doc/dtrace-$(VERSION) INSTDOCDIR = $(DESTDIR)$(DOCDIR) -MANDIR = $(prefix)/share/man/man8 +MANDIR = $(prefix)/share/man INSTMANDIR = $(DESTDIR)$(MANDIR) PKGCONFIGDIR = $(prefix)/share/pkgconfig INSTPKGCONFIGDIR = $(DESTDIR)$(PKGCONFIGDIR)
cmd/Build +1 -1
@@ -55,4 +55,4 @@ install:: $(call describe-install-target,$(INSTSBINDIR),dtrace) install -m 755 $(objdir)/dtrace $(INSTSBINDIR) $(call describe-install-target,$(INSTMANDIR),dtrace.8) - install -m 644 $(dtrace_DIR)/dtrace.8 $(INSTMANDIR) + install -m 644 $(dtrace_DIR)/dtrace.8 $(INSTMANDIR)/man8
configure +1 -1
@@ -58,7 +58,7 @@ Installation paths: --bindir=PREFIX/sbin Binary directory --sbindir=PREFIX/sbin Alias for --bindir --includedir=PREFIX/include #include directory ---mandir=PREFIX/share/man/man8 Manpage directory +--mandir=PREFIX/share/man Manpage directory --pkg-config-dir=PREFIX/share/pkgconfig Pkg-config directory --udevdir=PREFIX/lib/udev/rules.d udev rules directory --systemd-unit-dir=PREFIX/lib/systemd/system systemd unit directory
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 7/14 man: the synopsis is ended with .YS, not .SY
In reply to Nick Alcock.SY *starts* the synopsis.
--- cmd/dtrace.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
cmd/dtrace.8 +2 -2
@@ -33,8 +33,8 @@ dtrace \- DTrace dynamic tracing compiler and tracing utility .OP \-n [[[provider:]\ module:]\ function:]name\ [[predicate]\ action] .br .OP \-i probe-id\ [[predicate]\ action] -.SY - +.YS +. .SH DESCRIPTION .LP DTrace is a comprehensive dynamic tracing framework for the Linux operating system. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 8/14 man: use \- for option dashes, not -
In reply to Nick Alcock- is a line-breaking hyphen, almost always wrong for options. (Its use prevents the option from working when pasted into some terminal emulators.)
--- cmd/dtrace.8 | 116 +++++++++++++++++++++++++-------------------------- 1 file changed, 58 insertions(+), 58 deletions(-)
cmd/dtrace.8 +58 -58
@@ -57,119 +57,119 @@ Options that generate program stability reports Options that modify DTrace tracing and buffering behavior and enable additional D compiler features .RE .LP -You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fIOracle Linux DTrace Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks. +You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB\-e\fR option. See \fBOPTIONS\fR. See the \fIOracle Linux DTrace Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks. .SH OPTIONS .LP -The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid interpretation of meta-characters by the shell. +The arguments accepted by the \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, and \fB\-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid interpretation of meta-characters by the shell. .LP The following options are supported: .TP -\fB\fB-b\fR \fIbufsz\fR\fR +\fB\fB\-b\fR \fIbufsz\fR\fR Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property. .TP -\fB\fB-c\fR \fIcmd\fR\fR -Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fIOracle Linux DTrace Guide\fR for more information on macro variables. +\fB\fB\-c\fR \fIcmd\fR\fR +Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB\-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB\-s\fR option through the \fB$target\fR macro variable. Refer to the \fIOracle Linux DTrace Guide\fR for more information on macro variables. .TP -\fB\fB-C\fR\fR -Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR. +\fB\fB\-C\fR\fR +Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB\-D\fR, \fB\-U\fR, \fB\-I\fR, and \fB\-H\fR options. You can select the degree of C standard conformance if you use the \fB\-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB\-X\fR. .TP -\fB\fB-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR -Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR) and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation. +\fB\fB\-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR +Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). If you specify the equals sign (\fB=\fR) and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB\-D\fR option to each \fBcpp\fR invocation. .TP -\fB\fB-e\fR\fR +\fB\fB\-e\fR\fR Exit after compiling any requests, but prior to enabling any probes. You can combine this option with D compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation. .TP -\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR -Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched. The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time. +\fB\fB\-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR +Specify function name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched. The \fB\-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-f\fR option on the command line at a time. .TP -\fB\fB-F\fR\fR +\fB\fB\-F\fR\fR Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&. .TP -\fB\fB-G\fR\fR -Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR. Otherwise the ELF file is saved using the name \fBd.out\fR. +\fB\fB\-G\fR\fR +Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB\-o\fR option is present, the ELF file is saved using the pathname specified as the argument for this operand. If the \fB\-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR. Otherwise the ELF file is saved using the name \fBd.out\fR. .TP -\fB\fB-H\fR\fR -Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR. +\fB\fB\-H\fR\fR +Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). This option passes the \fB\-H\fR option to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR. .TP -\fB\fB-h\fR\fR -Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved using the name \fIfilename\fR\fB\&.h\fR. +\fB\fB\-h\fR\fR +Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB\-G\fR option. If the \fB\-o\fR option is present, the header file is saved using the pathname specified as the argument for that option. If the \fB\-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved using the name \fIfilename\fR\fB\&.h\fR. .TP -\fB\fB-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR -Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB-l\fR. The \fB-i\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-i\fR option at a time. +\fB\fB\-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR +Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB\-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB\-l\fR. The \fB\-i\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-i\fR option at a time. .TP -\fB\fB-I\fR \fIpath\fR\fR -Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list. +\fB\fB\-I\fR \fIpath\fR\fR +Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). This option passes the \fB\-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list. .TP -\fB\fB-L\fR \fIpath\fR\fR +\fB\fB\-L\fR \fIpath\fR\fR Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library search path. If it exists, a subdirectory of \fIpath\fR named after the minor version of the running kernel (e.g. 3.8) is searched immediately before \fIpath\fR. (But take note: dependency analysis is performed only within each directory, not across directories.) .TP -\fB\fB-l\fR\fR -List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR, and \fB-s\fR options. If none of these options are specified, this option lists all probes. +\fB\fB\-l\fR\fR +List probes instead of enabling them. If the \fB\-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, \fB\-i\fR, and \fB\-s\fR options. If none of these options are specified, this option lists all probes. .TP -\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR -Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D probe clause. More than one \fB-m\fR option can be specified on the command line at a time. +\fB\fB\-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR +Specify module name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB\-m\fR argument can be suffixed with an optional D probe clause. More than one \fB\-m\fR option can be specified on the command line at a time. .TP -\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR -Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR, or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time. +\fB\fB\-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR +Specify probe name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR, or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are matched. The \fB\-n\fR argument can be suffixed with an optional D probe clause. More than one \fB\-n\fR option can be specified on the command line at a time. .TP -\fB\fB-o\fR \fIoutput\fR\fR -Specify the \fIoutput\fR file for the \fB-G\fR, \fB-h\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR. Otherwise the default output file is \fBd.out\fR. +\fB\fB\-o\fR \fIoutput\fR\fR +Specify the \fIoutput\fR file for the \fB\-G\fR, \fB\-h\fR, and \fB\-l\fR options, or for the traced data itself. If the \fB\-G\fR option is present and the \fB\-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB\-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR. Otherwise the default output file is \fBd.out\fR. .TP -\fB\fB-p\fR \fIpid\fR\fR -Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fIOracle Linux DTrace Guide\fR for more information on macro variables. +\fB\fB\-p\fR \fIpid\fR\fR +Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB\-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB\-s\fR option through the \fB$target\fR macro variable. Refer to the \fIOracle Linux DTrace Guide\fR for more information on macro variables. .TP -\fB\fB-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR -Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-P\fR option on the command line at a time. +\fB\fB\-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR +Specify provider name to trace or list (\fB\-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB\-P\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-P\fR option on the command line at a time. .TP -\fB\fB-q\fR\fR +\fB\fB\-q\fR\fR Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR. .TP -\fB\fB-s\fR\fR -Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation is not enabled. If none of \fB-e\fR, \fB-l\fR, or \fB-G\fR are present, the instrumentation specified by the D program is enabled and tracing begins. +\fB\fB\-s\fR\fR +Compile the specified D program source file. If the \fB\-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB\-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation is not enabled. If none of \fB\-e\fR, \fB\-l\fR, or \fB\-G\fR are present, the instrumentation specified by the D program is enabled and tracing begins. .TP -\fB\fB-S\fR\fR +\fB\fB\-S\fR\fR Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR. .TP -\fB\fB-U\fR \fIname\fR\fR +\fB\fB\-U\fR \fIname\fR\fR Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation. .TP -\fB\fB-v\fR\fR -Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fIOracle Linux DTrace Guide\fR. +\fB\fB\-v\fR\fR +Set verbose mode. If the \fB\-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fIOracle Linux DTrace Guide\fR. .TP -\fB\fB-V\fR\fR -Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fIOracle Linux DTrace Guide\fR for more information about DTrace versioning features. In conjunction with \fB-v\fR, also reports information on the version of the \fBdtrace\fR(1) tool and associated library. +\fB\fB\-V\fR\fR +Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fIOracle Linux DTrace Guide\fR for more information about DTrace versioning features. In conjunction with \fB\-v\fR, also reports information on the version of the \fBdtrace\fR(1) tool and associated library. .TP -\fB\fB-w\fR\fR -Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not permit the compilation or enabling of a D program that contains destructive actions. +\fB\fB\-w\fR\fR +Permit destructive actions in D programs specified using the \fB\-s\fR, \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, or \fB\-i\fR options. If the \fB\-w\fR option is not specified, \fBdtrace\fR does not permit the compilation or enabling of a D program that contains destructive actions. .TP -\fB\fB-x\fR \fIarg\fR [\fI=val\fR]\fR +\fB\fB\-x\fR \fIarg\fR [\fI=val\fR]\fR Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fIOracle Linux DTrace Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and value with an equals sign (\fB=\fR). .TP -\fB\fB-Z\fR\fR -Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes. - +\fB\fB\-Z\fR\fR +Permit probe descriptions that match zero probes. If the \fB\-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB\-s\fR option) or on the command line (\fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, or \fB\-i\fR options) contain descriptions that do not match any known probes. +. .SH OPERANDS .LP -You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option or on the command line. The use of macro variables is described further in the \fIOracle Linux DTrace Guide\fR. - +You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB\-s\fR option or on the command line. The use of macro variables is described further in the \fIOracle Linux DTrace Guide\fR. +. .SH EXIT STATUS .LP The following exit values are returned: .TP .B 0 Successful completion. - +.IP For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests encountered errors or drops. .TP .B 1 An error occurred. - +.IP For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied. .TP .B 2 Invalid command line options or arguments were specified. .\" .RE - +. .SH "ENVIRONMENT VARIABLES" .LP The following environment variables are consulted:
@@ -180,7 +180,7 @@ Print CTF type library debugging output on standard error. .IP DTRACE_OPT_* Set a given DTrace option. -Options set this way are overridden both by options specified via \fB-x\fR on the command line, and by \fBsetopt\fR statements. +Options set this way are overridden both by options specified via \fB\-x\fR on the command line, and by \fBsetopt\fR statements. .SH SEE ALSO .BR cpp (1),
@@ -190,4 +190,4 @@ Options set this way are overridden both by options specified via \fB-x\fR on th .SH USAGE .LP -When using the \fB-p\fR flag, \fBdtrace\fR stops the target processes while it is inspecting them and reporting results. A process can do nothing while it is stopped. This means that, if , for example, the X server is inspected by \fBdtrace\fR running in a window under the X server's control, the whole window system can become deadlocked, because the \fBdtrace\fR tool would be attempting to display its results to a window that cannot be refreshed. In such a case, logging in from another system using \fBssh\fR(1) and killing the offending \fBdtrace\fR tool clears the deadlock. +When using the \fB\-p\fR flag, \fBdtrace\fR stops the target processes while it is inspecting them and reporting results. A process can do nothing while it is stopped. This means that, if, for example, the X server is inspected by \fBdtrace\fR running in a window under the X server's control, the whole window system can become deadlocked, because the \fBdtrace\fR tool would be attempting to display its results to a window that cannot be refreshed. In such a case, logging in from another system using \fBssh\fR(1) and killing the offending \fBdtrace\fR tool clears the deadlock.
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 9/14 man: drop blank lines
In reply to Nick AlcockThey don't do what you might expect in troff: a leading . is preferable.
--- cmd/dtrace.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
cmd/dtrace.8 +3 -3
@@ -179,15 +179,15 @@ Print libdtrace debugging output on standard error. Print CTF type library debugging output on standard error. .IP DTRACE_OPT_* Set a given DTrace option. - +. Options set this way are overridden both by options specified via \fB\-x\fR on the command line, and by \fBsetopt\fR statements. - +. .SH SEE ALSO .BR cpp (1), .BR ssh (1) .LP .I Oracle Linux DTrace Guide - +. .SH USAGE .LP When using the \fB\-p\fR flag, \fBdtrace\fR stops the target processes while it is inspecting them and reporting results. A process can do nothing while it is stopped. This means that, if, for example, the X server is inspected by \fBdtrace\fR running in a window under the X server's control, the whole window system can become deadlocked, because the \fBdtrace\fR tool would be attempting to display its results to a window that cannot be refreshed. In such a case, logging in from another system using \fBssh\fR(1) and killing the offending \fBdtrace\fR tool clears the deadlock.
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 10/14 man: fix blank line in environment variables list
In reply to Nick AlcockUse .IP instead, to get an indented linebreak.
--- cmd/dtrace.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/dtrace.8 +1 -1
@@ -179,7 +179,7 @@ Print libdtrace debugging output on standard error. Print CTF type library debugging output on standard error. .IP DTRACE_OPT_* Set a given DTrace option. -. +.IP Options set this way are overridden both by options specified via \fB\-x\fR on the command line, and by \fBsetopt\fR statements. . .SH SEE ALSO
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 11/14 dtprobed: fix parser child timeout
In reply to Nick AlcockThis was always meant to be five seconds, but when the option was rejigged to take seconds rather than milliseconds, the default was not changed, leading to a ridiculously huge multi-hour default timeout. We definitely don't want the parser child hanging for nearly two hours: go back to seconds again.
--- dtprobed/dtprobed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
dtprobed/dtprobed.c +1 -1
@@ -82,7 +82,7 @@ static pid_t parser_pid;static int parser_in_pipe;static int parser_out_pipe;static int sync_fd =-1 ; -static int timeout =5000 ;/* In seconds. */ +static int timeout =5 ;/* In seconds. */ static int rq_count =0 ;static int cleanup_interval =128 ;/* In requests. */
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 12/14 man: add manpage for dtprobed(8)
In reply to Nick AlcockCross-reference it from dtrace(8) and vice versa.
--- cmd/dtrace.8 | 3 ++- dtprobed/Build | 2 ++ dtprobed/dtprobed.8 | 64 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 dtprobed/dtprobed.8
cmd/dtrace.8 +2 -1
@@ -184,7 +184,8 @@ Options set this way are overridden both by options specified via \fB\-x\fR on t . .SH SEE ALSO .BR cpp (1), -.BR ssh (1) +.BR ssh (1), +.BR dtprobed (1) .LP .I Oracle Linux DTrace Guide .
dtprobed/Build +2 -0
@@ -57,6 +57,8 @@ install:: mkdir -p $(INSTSBINDIR) $(call describe-install-target,$(INSTSBINDIR),dtprobed) install -m 755 $(objdir)/dtprobed $(INSTSBINDIR) + $(call describe-install-target,$(INSTMANDIR),dtprobed.8) + install -m 644 $(dtprobed_DIR)/dtprobed.8 $(INSTMANDIR)/man8 mkdir -p $(INSTUDEVDIR) $(call describe-install-target,$(INSTUDEVDIR),60-dtprobed.rules) install -m 644 $(dtprobed_DIR)60-dtprobed.rules $(INSTUDEVDIR)
dtprobed/dtprobed.8 new file +64 -0
64 lines not on this page · raw message
Signature · 1 line
2.46.0.278.g36e3a12567
Re: [PATCH v2 12/14] man: add manpage for dtprobed(8)
Quoted 4 lines · Nick Alcock
Cross-reference it from dtrace(8) and vice versa.
Quoted 107 lines
--- cmd/dtrace.8 | 3 ++- dtprobed/Build | 2 ++ dtprobed/dtprobed.8 | 64 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 dtprobed/dtprobed.8cmd/dtrace.8 +2
-1@@ -184,7 +184,8 @@ Options set this way are overridden both by options specified via \fB\-x\fR on t . .SH SEE ALSO .BR cpp (1), -.BR ssh (1) +.BR ssh (1), +.BR dtprobed (1) .LP .I Oracle Linux DTrace Guide .dtprobed/Build +2
-0@@ -57,6 +57,8 @@ install:: mkdir -p $(INSTSBINDIR) $(call describe-install-target,$(INSTSBINDIR),dtprobed) install -m 755 $(objdir)/dtprobed $(INSTSBINDIR) + $(call describe-install-target,$(INSTMANDIR),dtprobed.8) + install -m 644 $(dtprobed_DIR)/dtprobed.8 $(INSTMANDIR)/man8 mkdir -p $(INSTUDEVDIR) $(call describe-install-target,$(INSTUDEVDIR),60-dtprobed.rules) install -m 644 $(dtprobed_DIR)60-dtprobed.rules $(INSTUDEVDIR)dtprobed/dtprobed.8 new file +64
-0@@ -0,0 +1,64 @@ +'\" te +.\" Oracle Linux DTrace. +.\" Copyright (c) 2009, 2024, Oracle and/or its affiliates. All Rights Reserved. +.\" Licensed under the Universal Permissive License v 1.0 as shown at +.\" http://oss.oracle.com/licenses/upl. +.TH dtrace 8 "22 Oct 2023" "Oracle Linux" "Linux Programmer's Manual" +.SH NAME +dtprobed \- USDT-tracking daemon +.SH SYNOPSIS +.SY dtprobed +.OP -Fd +.OP \-d devname +.OP \-t timeout +.YS +. +.SH DESCRIPTION +.LP +\fBdtprobed\fP is a component of the DTrace system that keeps track of USDT probes within running processes, parsing and storing the DOF they provide for later consumption by \fBdtrace\fP proper. +.LP +\fBdtprobed\fP should be started as soon as possible after startup and should always be kept running: processes that start before it may not have usable USDT probes. On systemd systems this is usually done automatically. (Restarting on upgrade should also be done for you by the packaging system.) +.LP +The following options are supported: +.TP +\fB\-F\fP +Put \fBdtprobed\fP into the foreground: log output to \fIstderr\fP instead of the syslog. (Routinely used by systemd.) +.TP +\fB\-d\fP +Enable debugging: log extra output, and disable sandboxing of the DOF parser. +.TP +\fB-n\fP \fIdevname\fP +Name the CUSE device something other than the default \fIdtrace/helper\fP. DOF-containing processes will not connect to this instance unless pointed at it via the \fIDTRACE_DOF_INIT_DEVNAME\fP environment variable. Using this option is necessary if for some reason (perhaps debugging) you want to have two dtprobeds running at once. (They will still share a state directory, so DTrace will know about all probes discovered by all running \fBdtprobed\fPs.) +.TP +\fB\-t\fP \fItimeout\fP +Timeout, in seconds, for DOF reads from the parser child. DOF that takes longer than this to parse will be discarded. The default (5 seconds) is probably always reasonable. Setting this too low might cause legitimate DOF to be discarded: setting it too high might cause faulty DOF to block \fBdtprobed\fP, preventing registration of new probes. +. +.SH "ENVIRONMENT VARIABLES" +.LP +Ignoring internal testing-only variables, \fBdtprobed\fP itself does not accept any environment variables: but programs that talk to it (any program that contains USDT probes) do accept some. +.TP +\fIDTRACE_DOF_INIT_DEBUG\fP +Output debugging messages to standard error if set (to anything). +.TP +\fIDTRACE_DOF_INIT_DEVNAME\fP +The full name of the helper device to send registration requests on: by default, \fI/dev/dtrace/helper\fP. \fBdtprobed\fP is listening on the other end of this device. +.TP +\fIDTRACE_DOF_INIT_DISABLE\fP +Disable DOF registration entirely. +. +.SH FILES +. +.TP +\fI/run/dtrace/stash\fP +Private stash of DOF. +.TP +\fI/run/dtrace/probes\fP +Parsed representations of every probe. The parsed representation is shared between +.MR dtrace 8 +and \fBdtprobed\fP, and can change between releases: on upgrade, \fBdtprobed\fP should be restarted, and will regenerate any parsed DOF that is needed, so \fBdtrace\fPs started after the upgrade will still work. (Still-running \fBdtrace\fPs from before the upgrade may become unable to see newly-added probes.) +. +.SH SEE ALSO +. +.BR dtrace (8) +.LP +.I Oracle Linux DTrace GuideSignature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 13/14 man: drop double-\fB at the start of every option line
In reply to Nick AlcockAll this does is stops \fP (which goes back to the previous font) from working. (The manpage looks fine afterwards, both on the terminal and typeset.)
--- cmd/dtrace.8 | 56 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-)
cmd/dtrace.8 +28 -28
@@ -64,88 +64,88 @@ The arguments accepted by the \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, and \f .LP The following options are supported: .TP -\fB\fB\-b\fR \fIbufsz\fR\fR +\fB\-b\fP \fIbufsz\fP Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property. .TP -\fB\fB\-c\fR \fIcmd\fR\fR +\fB\-c\fP \fIcmd\fP Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB\-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB\-s\fR option through the \fB$target\fR macro variable. Refer to the \fIOracle Linux DTrace Guide\fR for more information on macro variables. .TP -\fB\fB\-C\fR\fR +\fB\-C\fP Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB\-D\fR, \fB\-U\fR, \fB\-I\fR, and \fB\-H\fR options. You can select the degree of C standard conformance if you use the \fB\-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB\-X\fR. .TP -\fB\fB\-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR +\fB\-D\fP \fIname\fP \fB[=\fP\fIvalue\fP\fB]\fP Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). If you specify the equals sign (\fB=\fR) and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB\-D\fR option to each \fBcpp\fR invocation. .TP -\fB\fB\-e\fR\fR +\fB\-e\fP Exit after compiling any requests, but prior to enabling any probes. You can combine this option with D compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation. .TP -\fB\fB\-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR +\fB\-f\fP\fB[[\fP\fIprovider\fP\fB:]\fP\fImodule\fP\fB:]\fP\fIfunction\fP\fB[[\fP\fIpredicate\fP\fB]\fP\fIaction\fP\fB]]\fP Specify function name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched. The \fB\-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-f\fR option on the command line at a time. .TP -\fB\fB\-F\fR\fR +\fB\-F\fP Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&. .TP -\fB\fB\-G\fR\fR +\fB\-G\fP Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB\-o\fR option is present, the ELF file is saved using the pathname specified as the argument for this operand. If the \fB\-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR. Otherwise the ELF file is saved using the name \fBd.out\fR. .TP -\fB\fB\-H\fR\fR +\fB\-H\fP Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). This option passes the \fB\-H\fR option to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR. .TP -\fB\fB\-h\fR\fR +\fB\-h\fP Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB\-G\fR option. If the \fB\-o\fR option is present, the header file is saved using the pathname specified as the argument for that option. If the \fB\-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved using the name \fIfilename\fR\fB\&.h\fR. .TP -\fB\fB\-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR +\fB\-i\fP \fIprobe-id\fP\fB[[\fP\fIpredicate\fP] \fIaction\fP\fB]\fP Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB\-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB\-l\fR. The \fB\-i\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-i\fR option at a time. .TP -\fB\fB\-I\fR \fIpath\fR\fR +\fB\-I\fP \fIpath\fP Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). This option passes the \fB\-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list. .TP -\fB\fB\-L\fR \fIpath\fR\fR +\fB\-L\fP \fIpath\fP Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library search path. If it exists, a subdirectory of \fIpath\fR named after the minor version of the running kernel (e.g. 3.8) is searched immediately before \fIpath\fR. (But take note: dependency analysis is performed only within each directory, not across directories.) .TP -\fB\fB\-l\fR\fR +\fB\-l\fP List probes instead of enabling them. If the \fB\-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, \fB\-i\fR, and \fB\-s\fR options. If none of these options are specified, this option lists all probes. .TP -\fB\fB\-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR +\fB\-m\fP [[\fIprovider:\fP] \fImodule:\fP [[\fIpredicate\fP] \fIaction\fP]] Specify module name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB\-m\fR argument can be suffixed with an optional D probe clause. More than one \fB\-m\fR option can be specified on the command line at a time. .TP -\fB\fB\-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR +\fB\-n\fP [[[\fIprovider:\fP] \fImodule:\fP] \fIfunction:\fP] \fIname\fP [[\fIpredicate\fP] \fIaction\fP] Specify probe name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR, or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are matched. The \fB\-n\fR argument can be suffixed with an optional D probe clause. More than one \fB\-n\fR option can be specified on the command line at a time. .TP -\fB\fB\-o\fR \fIoutput\fR\fR +\fB\-o\fP \fIoutput\fP Specify the \fIoutput\fR file for the \fB\-G\fR, \fB\-h\fR, and \fB\-l\fR options, or for the traced data itself. If the \fB\-G\fR option is present and the \fB\-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB\-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR. Otherwise the default output file is \fBd.out\fR. .TP -\fB\fB\-p\fR \fIpid\fR\fR +\fB\-p\fP \fIpid\fP Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB\-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB\-s\fR option through the \fB$target\fR macro variable. Refer to the \fIOracle Linux DTrace Guide\fR for more information on macro variables. .TP -\fB\fB\-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR +\fB\-P\fP \fIprovider\fP \fB[[\fP\fIpredicate\fP\fB]\fP \fIaction\fP] Specify provider name to trace or list (\fB\-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB\-P\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-P\fR option on the command line at a time. .TP -\fB\fB\-q\fR\fR +\fB\-q\fP Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR. .TP -\fB\fB\-s\fR\fR +\fB\-s\fP Compile the specified D program source file. If the \fB\-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB\-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation is not enabled. If none of \fB\-e\fR, \fB\-l\fR, or \fB\-G\fR are present, the instrumentation specified by the D program is enabled and tracing begins. .TP -\fB\fB\-S\fR\fR +\fB\-S\fP Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR. .TP -\fB\fB\-U\fR \fIname\fR\fR +\fB\-U\fP \fIname\fP Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation. .TP -\fB\fB\-v\fR\fR +\fB\-v\fP Set verbose mode. If the \fB\-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fIOracle Linux DTrace Guide\fR. .TP -\fB\fB\-V\fR\fR +\fB\-V\fP Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fIOracle Linux DTrace Guide\fR for more information about DTrace versioning features. In conjunction with \fB\-v\fR, also reports information on the version of the \fBdtrace\fR(1) tool and associated library. .TP -\fB\fB\-w\fR\fR +\fB\-w\fP Permit destructive actions in D programs specified using the \fB\-s\fR, \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, or \fB\-i\fR options. If the \fB\-w\fR option is not specified, \fBdtrace\fR does not permit the compilation or enabling of a D program that contains destructive actions. .TP -\fB\fB\-x\fR \fIarg\fR [\fI=val\fR]\fR +\fB\-x\fP \fIarg\fP [\fI=val\fP] Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fIOracle Linux DTrace Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and value with an equals sign (\fB=\fR). .TP -\fB\fB\-Z\fR\fR +\fB\-Z\fP Permit probe descriptions that match zero probes. If the \fB\-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB\-s\fR option) or on the command line (\fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, or \fB\-i\fR options) contain descriptions that do not match any known probes. . .SH OPERANDS
Signature · 1 line
2.46.0.278.g36e3a12567
PATCH v2 14/14 man: \fP-ize
In reply to Nick AlcockThis adjusts everything to use \fN...\fP rather than \fN...\fR everywhere:
the few places that were using \fP (usually \fB\fIfilename\fP.ext\fR) were re-expressed into \fIfilename\fP\fB.ext\fP. \& was added in the instances of this pattern that weren't using it (about half were).
No effect on terminal or typeset output, other than very slightly improved layout around the filename stuff above.
--- cmd/dtrace.8 | 72 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-)
cmd/dtrace.8 +36 -36
@@ -39,9 +39,9 @@ dtrace \- DTrace dynamic tracing compiler and tracing utility .LP DTrace is a comprehensive dynamic tracing framework for the Linux operating system. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs. .LP -The \fIOracle Linux DTrace Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability tools, instrumentation providers, and the D programming language. +The \fIOracle Linux DTrace Guide\fP describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability tools, instrumentation providers, and the D programming language. .LP -The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including: +The \fBdtrace\fP command provides a generic interface to the essential services provided by the DTrace facility, including: .RS +4 .IP o Options that list the set of probes and providers currently published by DTrace
@@ -57,100 +57,100 @@ Options that generate program stability reports Options that modify DTrace tracing and buffering behavior and enable additional D compiler features .RE .LP -You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB\-e\fR option. See \fBOPTIONS\fR. See the \fIOracle Linux DTrace Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks. +You can use \fBdtrace\fP to create D scripts by using it in a \fB#!\fP declaration to create an interpreter file. You can also use \fBdtrace\fP to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB\-e\fP option. See \fBOPTIONS\fP. See the \fIOracle Linux DTrace Guide\fP for detailed examples of how to use the \fBdtrace\fP utility to perform these tasks. .SH OPTIONS .LP -The arguments accepted by the \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, and \fB\-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid interpretation of meta-characters by the shell. +The arguments accepted by the \fB\-P\fP, \fB\-m\fP, \fB\-f\fP, \fB\-n\fP, and \fB\-i\fP options can include an optional D language \fIpredicate\fP enclosed in slashes \fB//\fP and optional D language \fIaction\fP statement list enclosed in braces \fB{}\fP. D program code specified on the command line must be appropriately quoted to avoid interpretation of meta-characters by the shell. .LP The following options are supported: .TP \fB\-b\fP \fIbufsz\fP -Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property. +Set principal trace buffer size (\fIbufsz\fP). The trace buffer size can include any of the size suffixes \fBk\fP, \fBm\fP, \fBg\fP, or \fBt\fP. If the buffer space cannot be allocated, \fBdtrace\fP attempts to reduce the buffer size or exit depending on the setting of the \fBbufresize\fP property. .TP \fB\-c\fP \fIcmd\fP -Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB\-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB\-s\fR option through the \fB$target\fR macro variable. Refer to the \fIOracle Linux DTrace Guide\fR for more information on macro variables. +Run the specified command \fIcmd\fP and exit upon its completion. If more than one \fB\-c\fP option is present on the command line, \fBdtrace\fP exits when all commands have exited, reporting the exit status for each child process as it terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB\-s\fP option through the \fB$target\fP macro variable. Refer to the \fIOracle Linux DTrace Guide\fP for more information on macro variables. .TP \fB\-C\fP -Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB\-D\fR, \fB\-U\fR, \fB\-I\fR, and \fB\-H\fR options. You can select the degree of C standard conformance if you use the \fB\-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB\-X\fR. +Run the C preprocessor \fBcpp\fP(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB\-D\fP, \fB\-U\fP, \fB\-I\fP, and \fB\-H\fP options. You can select the degree of C standard conformance if you use the \fB\-X\fP option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB\-X\fP. .TP \fB\-D\fP \fIname\fP \fB[=\fP\fIvalue\fP\fB]\fP -Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). If you specify the equals sign (\fB=\fR) and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB\-D\fR option to each \fBcpp\fR invocation. +Define \fIname\fP when invoking \fBcpp\fP(1) (enabled using the \fB\-C\fP option). If you specify the equals sign (\fB=\fP) and additional \fIvalue\fP, the name is assigned the corresponding value. This option passes the \fB\-D\fP option to each \fBcpp\fP invocation. .TP \fB\-e\fP Exit after compiling any requests, but prior to enabling any probes. You can combine this option with D compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation. .TP \fB\-f\fP\fB[[\fP\fIprovider\fP\fB:]\fP\fImodule\fP\fB:]\fP\fIfunction\fP\fB[[\fP\fIpredicate\fP\fB]\fP\fIaction\fP\fB]]\fP -Specify function name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched. The \fB\-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-f\fR option on the command line at a time. +Specify function name to trace or list (\fB\-l\fP option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fP, \fImodule:function\fP, or \fIfunction\fP. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fP are specified in the description, all probes with the corresponding \fIfunction\fP are matched. The \fB\-f\fP argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-f\fP option on the command line at a time. .TP \fB\-F\fP -Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&. +Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fP. Function return probe reports are unindented and their output is prefixed with \fB<-\fP\&. System call entry probe reports are indented and their output is prefixed with \fB=>\fP. System call return probe reports are unindented and their output is prefixed with \fB<=\fP\&. .TP \fB\-G\fP -Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB\-o\fR option is present, the ELF file is saved using the pathname specified as the argument for this operand. If the \fB\-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR. Otherwise the ELF file is saved using the name \fBd.out\fR. +Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB\-o\fP option is present, the ELF file is saved using the pathname specified as the argument for this operand. If the \fB\-o\fP option is not present and the DTrace program is contained with a file whose name is \fIfilename\fP\fB\&.d\fP, then the ELF file is saved using the name \fIfilename\fP\fB\&.o\fP. Otherwise the ELF file is saved using the name \fBd.out\fP. .TP \fB\-H\fP -Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). This option passes the \fB\-H\fR option to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR. +Print the pathnames of included files when invoking \fBcpp\fP(1) (enabled using the \fB\-C\fP option). This option passes the \fB\-H\fP option to each \fBcpp\fP invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fP. .TP \fB\-h\fP -Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB\-G\fR option. If the \fB\-o\fR option is present, the header file is saved using the pathname specified as the argument for that option. If the \fB\-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved using the name \fIfilename\fR\fB\&.h\fR. +Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB\-G\fP option. If the \fB\-o\fP option is present, the header file is saved using the pathname specified as the argument for that option. If the \fB\-o\fP option is not present and the DTrace program is contained with a file whose name is \fIfilename\fP\fB\&.d\fP, then the header file is saved using the name \fIfilename\fP\fB\&.h\fP. .TP \fB\-i\fP \fIprobe-id\fP\fB[[\fP\fIpredicate\fP] \fIaction\fP\fB]\fP -Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB\-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB\-l\fR. The \fB\-i\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-i\fR option at a time. +Specify probe identifier (\fIprobe-id\fP) to trace or list (\fB\-l\fP option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fP \fB\-l\fP. The \fB\-i\fP argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-i\fP option at a time. .TP \fB\-I\fP \fIpath\fP -Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled using the \fB\-C\fR option). This option passes the \fB\-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list. +Add the specified directory \fIpath\fP to the search path for \fB#include\fP files when invoking \fBcpp\fP(1) (enabled using the \fB\-C\fP option). This option passes the \fB\-I\fP option to each \fBcpp\fP invocation. The specified \fIpath\fP is inserted into the search path ahead of the default directory list. .TP \fB\-L\fP \fIpath\fP -Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library search path. If it exists, a subdirectory of \fIpath\fR named after the minor version of the running kernel (e.g. 3.8) is searched immediately before \fIpath\fR. (But take note: dependency analysis is performed only within each directory, not across directories.) +Add the specified directory \fIpath\fP to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fP is added after the default library search path. If it exists, a subdirectory of \fIpath\fP named after the minor version of the running kernel (e.g. 3.8) is searched immediately before \fIpath\fP. (But take note: dependency analysis is performed only within each directory, not across directories.) .TP \fB\-l\fP -List probes instead of enabling them. If the \fB\-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, \fB\-i\fR, and \fB\-s\fR options. If none of these options are specified, this option lists all probes. +List probes instead of enabling them. If the \fB\-l\fP option is specified, \fBdtrace\fP produces a report of the probes matching the descriptions given using the \fB\-P\fP, \fB\-m\fP, \fB\-f\fP, \fB\-n\fP, \fB\-i\fP, and \fB\-s\fP options. If none of these options are specified, this option lists all probes. .TP \fB\-m\fP [[\fIprovider:\fP] \fImodule:\fP [[\fIpredicate\fP] \fIaction\fP]] -Specify module name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB\-m\fR argument can be suffixed with an optional D probe clause. More than one \fB\-m\fR option can be specified on the command line at a time. +Specify module name to trace or list (\fB\-l\fP option). The corresponding argument can include any of the probe description forms \fIprovider:module\fP or \fImodule\fP. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fP are specified in the description, all probes with a corresponding \fImodule\fP are matched. The \fB\-m\fP argument can be suffixed with an optional D probe clause. More than one \fB\-m\fP option can be specified on the command line at a time. .TP \fB\-n\fP [[[\fIprovider:\fP] \fImodule:\fP] \fIfunction:\fP] \fIname\fP [[\fIpredicate\fP] \fIaction\fP] -Specify probe name to trace or list (\fB\-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR, or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are matched. The \fB\-n\fR argument can be suffixed with an optional D probe clause. More than one \fB\-n\fR option can be specified on the command line at a time. +Specify probe name to trace or list (\fB\-l\fP option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fP, \fImodule:function:name\fP, \fIfunction:name\fP, or \fIname\fP. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fP are specified in the description, all probes with a corresponding \fIname\fP are matched. The \fB\-n\fP argument can be suffixed with an optional D probe clause. More than one \fB\-n\fP option can be specified on the command line at a time. .TP \fB\-o\fP \fIoutput\fP -Specify the \fIoutput\fR file for the \fB\-G\fR, \fB\-h\fR, and \fB\-l\fR options, or for the traced data itself. If the \fB\-G\fR option is present and the \fB\-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB\-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR. Otherwise the default output file is \fBd.out\fR. +Specify the \fIoutput\fP file for the \fB\-G\fP, \fB\-h\fP, and \fB\-l\fP options, or for the traced data itself. If the \fB\-G\fP option is present and the \fB\-s\fP option's argument is of the form \fIfilename\fP\fB\&.d\fP and \fB\-o\fP is not present, the default output file is \fIfilename\fP\fB\&.o\fP. Otherwise the default output file is \fBd.out\fP. .TP \fB\-p\fP \fIpid\fP -Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB\-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB\-s\fR option through the \fB$target\fR macro variable. Refer to the \fIOracle Linux DTrace Guide\fR for more information on macro variables. +Grab the specified process-ID \fIpid\fP, cache its symbol tables, and exit upon its completion. If more than one \fB\-p\fP option is present on the command line, \fBdtrace\fP exits when all commands have exited, reporting the exit status for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB\-s\fP option through the \fB$target\fP macro variable. Refer to the \fIOracle Linux DTrace Guide\fP for more information on macro variables. .TP \fB\-P\fP \fIprovider\fP \fB[[\fP\fIpredicate\fP\fB]\fP \fIaction\fP] -Specify provider name to trace or list (\fB\-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB\-P\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-P\fR option on the command line at a time. +Specify provider name to trace or list (\fB\-l\fP option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB\-P\fP argument can be suffixed with an optional D probe clause. You can specify more than one \fB\-P\fP option on the command line at a time. .TP \fB\-q\fP -Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR. +Set quiet mode. \fBdtrace\fP suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program statements such as \fBtrace()\fP and \fBprintf()\fP is displayed to \fBstdout\fP. .TP \fB\-s\fP -Compile the specified D program source file. If the \fB\-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB\-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation is not enabled. If none of \fB\-e\fR, \fB\-l\fR, or \fB\-G\fR are present, the instrumentation specified by the D program is enabled and tracing begins. +Compile the specified D program source file. If the \fB\-e\fP option is present, the program is compiled but instrumentation is not enabled. If the \fB\-l\fP option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation is not enabled. If none of \fB\-e\fP, \fB\-l\fP, or \fB\-G\fP are present, the instrumentation specified by the D program is enabled and tracing begins. .TP \fB\-S\fP -Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR. +Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fP. .TP \fB\-U\fP \fIname\fP -Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation. +Undefine the specified \fIname\fP when invoking \fBcpp\fP(1) (enabled using the \fB-C\fP option). This option passes the \fB-U\fP option to each \fBcpp\fP invocation. .TP \fB\-v\fP -Set verbose mode. If the \fB\-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fIOracle Linux DTrace Guide\fR. +Set verbose mode. If the \fB\-v\fP option is specified, \fBdtrace\fP produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fIOracle Linux DTrace Guide\fP. .TP \fB\-V\fP -Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fIOracle Linux DTrace Guide\fR for more information about DTrace versioning features. In conjunction with \fB\-v\fR, also reports information on the version of the \fBdtrace\fR(1) tool and associated library. +Report the highest D programming interface version supported by \fBdtrace\fP. The version information is printed to \fBstdout\fP and the \fBdtrace\fP command exits. Refer to the \fIOracle Linux DTrace Guide\fP for more information about DTrace versioning features. In conjunction with \fB\-v\fP, also reports information on the version of the \fBdtrace\fP(1) tool and associated library. .TP \fB\-w\fP -Permit destructive actions in D programs specified using the \fB\-s\fR, \fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, or \fB\-i\fR options. If the \fB\-w\fR option is not specified, \fBdtrace\fR does not permit the compilation or enabling of a D program that contains destructive actions. +Permit destructive actions in D programs specified using the \fB\-s\fP, \fB\-P\fP, \fB\-m\fP, \fB\-f\fP, \fB\-n\fP, or \fB\-i\fP options. If the \fB\-w\fP option is not specified, \fBdtrace\fP does not permit the compilation or enabling of a D program that contains destructive actions. .TP \fB\-x\fP \fIarg\fP [\fI=val\fP] -Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fIOracle Linux DTrace Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and value with an equals sign (\fB=\fR). +Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fIOracle Linux DTrace Guide\fP. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and value with an equals sign (\fB=\fP). .TP \fB\-Z\fP -Permit probe descriptions that match zero probes. If the \fB\-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB\-s\fR option) or on the command line (\fB\-P\fR, \fB\-m\fR, \fB\-f\fR, \fB\-n\fR, or \fB\-i\fR options) contain descriptions that do not match any known probes. +Permit probe descriptions that match zero probes. If the \fB\-Z\fP option is not specified, \fBdtrace\fP reports an error and exits if any probe descriptions specified in D program files (\fB\-s\fP option) or on the command line (\fB\-P\fP, \fB\-m\fP, \fB\-f\fP, \fB\-n\fP, or \fB\-i\fP options) contain descriptions that do not match any known probes. . .SH OPERANDS .LP -You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB\-s\fR option or on the command line. The use of macro variables is described further in the \fIOracle Linux DTrace Guide\fR. +You can specify zero or more additional arguments on the \fBdtrace\fP command line to define a set of macro variables (\fB$1\fP, \fB$2\fP, and so forth). The additional arguments can be used in D programs specified using the \fB\-s\fP option or on the command line. The use of macro variables is described further in the \fIOracle Linux DTrace Guide\fP. . .SH EXIT STATUS .LP
@@ -159,12 +159,12 @@ The following exit values are returned: .B 0 Successful completion. .IP -For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests encountered errors or drops. +For D program requests, an exit status of \fB0\fP indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fP returns \fB0\fP even if the specified tracing requests encountered errors or drops. .TP .B 1 An error occurred. .IP -For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied. +For D program requests, an exit status of \fB1\fP indicates that program compilation failed or that the specified request could not be satisfied. .TP .B 2 Invalid command line options or arguments were specified.
@@ -180,7 +180,7 @@ Print CTF type library debugging output on standard error. .IP DTRACE_OPT_* Set a given DTrace option. .IP -Options set this way are overridden both by options specified via \fB\-x\fR on the command line, and by \fBsetopt\fR statements. +Options set this way are overridden both by options specified via \fB\-x\fP on the command line, and by \fBsetopt\fP statements. . .SH SEE ALSO .BR cpp (1),
@@ -191,4 +191,4 @@ Options set this way are overridden both by options specified via \fB\-x\fR on t . .SH USAGE .LP -When using the \fB\-p\fR flag, \fBdtrace\fR stops the target processes while it is inspecting them and reporting results. A process can do nothing while it is stopped. This means that, if, for example, the X server is inspected by \fBdtrace\fR running in a window under the X server's control, the whole window system can become deadlocked, because the \fBdtrace\fR tool would be attempting to display its results to a window that cannot be refreshed. In such a case, logging in from another system using \fBssh\fR(1) and killing the offending \fBdtrace\fR tool clears the deadlock. +When using the \fB\-p\fP flag, \fBdtrace\fP stops the target processes while it is inspecting them and reporting results. A process can do nothing while it is stopped. This means that, if, for example, the X server is inspected by \fBdtrace\fP running in a window under the X server's control, the whole window system can become deadlocked, because the \fBdtrace\fP tool would be attempting to display its results to a window that cannot be refreshed. In such a case, logging in from another system using \fBssh\fP(1) and killing the offending \fBdtrace\fP tool clears the deadlock.
Signature · 1 line
2.46.0.278.g36e3a12567