[DTrace-devel] [oracle/dtrace-utils] 83852f: Allow probes not to attach if they were not "needed"

euloh noreply at github.com
Mon Oct 13 21:22:08 UTC 2025


  Branch: refs/heads/dev-queue
  Home:   https://github.com/oracle/dtrace-utils
  Commit: 83852f661d4b7d90dcb5430eb8cda1ffcf4fac35
      https://github.com/oracle/dtrace-utils/commit/83852f661d4b7d90dcb5430eb8cda1ffcf4fac35
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M include/dtrace/pid.h
    M libdtrace/dt_bpf.c
    M libdtrace/dt_pid.c
    M libdtrace/dt_probe.h
    M libdtrace/dt_prov_uprobe.c
    A test/unittest/pid/err.opt_after_needed.aarch64.x
    A test/unittest/pid/err.opt_after_needed.sh
    A test/unittest/pid/err.opt_after_needed.x86_64.x
    A test/unittest/pid/err.opt_before_needed.aarch64.x
    A test/unittest/pid/err.opt_before_needed.sh
    A test/unittest/pid/err.opt_before_needed.x86_64.x
    A test/unittest/pid/err.optional.aarch64.x
    A test/unittest/pid/err.optional.sh
    A test/unittest/pid/err.optional.x86_64.x
    M test/unittest/pid/tst.entry_off0.sh

  Log Message:
  -----------
  Allow probes not to attach if they were not "needed"

Various kernels prevent the placement of uprobes on particular
instructions -- e.g., on x86 on hlt or multi-byte nops, or on aarch64 on
autiasp.  This means, for example, that one cannot place a pid probe on
every possible instruction.  If a user explicitly places a probe on a
forbidden instruction, an error message indicates there is a problem.

On the other hand, if the user specifies a wildcard in a pid probe
name, we should skip instructions where no uprobe can be placed.

The problem is that we do not find out an instruction is problematic
until we try to attach, which is long after probe descriptions have been
processed.  And when we walk probe descriptions, we do not have
information about which kernels and instructions are problematic.

The motivating problem pertains to pid probes, but we would like
a provider-agnostic solution.

Set an "OPTIONAL" probe flag when a probe is not needed:

* In dt_probe.h, DT_PROBE_FLAG_OPTIONAL is used for the "flags"
  member of dt_probe_t.

* For pid-style probes (including USDT and stapsdt), in
  include/dtrace/pid.h, DT_PID_PSP_FLAG_OPTIONAL is used for
  the pps_flags member of pid_probespec_t.

Remove the old check on "hlt" instructions, since it was not sufficiently
general for other kernels and other problematic instructions.

Existing tests that expose the problem are

    test/unittest/pid/tst.coverage.d
    test/unittest/pid/tst.emptystack.d
    test/unittest/pid/tst.entry_off0.sh
        hlt instruction on x86

    test/unittest/pid/tst.float.d
        multi-byte nop on x86 on newer platforms

    test/unittest/pid/tst.entry_off0.sh
        autiasp instruction on aarch64 on newer platforms
        depending on how the trigger process was built

New tests are added to check that a probe set explicitly on a
problematic instruction will still lead to an error, even if a
probe description before or after it tolerates attach failure.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 95982c4c39a36f91c387aba3a944ba10018b0298
      https://github.com/oracle/dtrace-utils/commit/95982c4c39a36f91c387aba3a944ba10018b0298
  Author: Elena Zannoni <elena.zannoni at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M Build

  Log Message:
  -----------
  Add examples directory to installed doc directory

Make sure that the examples directory gets installed.
It will be installed under /usr/share/doc/dtrace/examples.

Signed-off-by: Elena Zannoni <elena.zannoni at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>


  Commit: d146c0033c59e4a5fdcc6079b43ae8ce5162d2d1
      https://github.com/oracle/dtrace-utils/commit/d146c0033c59e4a5fdcc6079b43ae8ce5162d2d1
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M dlibs/aarch64/5.11/net.d
    M dlibs/aarch64/5.12/net.d
    M dlibs/aarch64/5.14/net.d
    M dlibs/aarch64/5.16/net.d
    M dlibs/aarch64/5.2/net.d
    M dlibs/aarch64/5.6/net.d
    M dlibs/aarch64/6.1/net.d
    M dlibs/aarch64/6.10/net.d
    M dlibs/x86_64/5.11/net.d
    M dlibs/x86_64/5.12/net.d
    M dlibs/x86_64/5.14/net.d
    M dlibs/x86_64/5.16/net.d
    M dlibs/x86_64/5.2/net.d
    M dlibs/x86_64/5.6/net.d
    M dlibs/x86_64/6.1/net.d
    M dlibs/x86_64/6.10/net.d
    M libdtrace/net.d

  Log Message:
  -----------
  Fix comment since pkt_addr is not NULL

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 7589be16adf01d6082132a714205dad00c2c37af
      https://github.com/oracle/dtrace-utils/commit/7589be16adf01d6082132a714205dad00c2c37af
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M test/unittest/aggs/tst.chararray-key.d

  Log Message:
  -----------
  test: Turn char[16] into string to ignore garbage bytes

In commit 308e996c0 ("cg, agg: fix alignment of key components"), a new
test test/unittest/aggs/tst.chararray-key.d used a char[16] as an agg key.
The problem is that the char array, curpsinfo->pr_fname, could have
garbage bytes after the first NUL byte, polluting test output.

Since we do not care about any such garbage bytes, convert to a string.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 8514c49fe5753c315e2292a8310ae328743b7082
      https://github.com/oracle/dtrace-utils/commit/8514c49fe5753c315e2292a8310ae328743b7082
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M test/unittest/proc/tst.exec-execveat.sh

  Log Message:
  -----------
  test: Use syscall in case of no execveat() wrapper

While execveat() appeared in kernel 3.19, GNU C library support
came later.  We are still testing on some systems with older libc.

Do not assume libc has an execveat() wrapper:  use syscall().

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 4bbff3432285f8441928fab39e87c5d300e5d2ac
      https://github.com/oracle/dtrace-utils/commit/4bbff3432285f8441928fab39e87c5d300e5d2ac
  Author: Nick Alcock <nick.alcock at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M test/unittest/fbtprovider/tst.return0.d
    M test/unittest/fbtprovider/tst.return0.r
    M test/unittest/providers/rawfbt/tst.return0.d
    M test/unittest/providers/rawfbt/tst.return0.r

  Log Message:
  -----------
  test: fbt return0: work on quiet systems

These two tests probe on sys_poll and just hope something calls it.
On sufficiently quiet systems, nothing does.

Use hrtimer_nanosleep instead.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: f871e903aff16e028ce26b29329978379d1e49c1
      https://github.com/oracle/dtrace-utils/commit/f871e903aff16e028ce26b29329978379d1e49c1
  Author: Nick Alcock <nick.alcock at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M test/triggers/io-mount-nfs.sh
    M test/unittest/io/tst.nfs2.sh

  Log Message:
  -----------
  test: nfs: don't require a locking daemon

On modern (NFSv4) systems, there is no guarantee that statd is running,
and indeed it has probably been explicitly turned off (unless writable
NFSv3 exports exist).  This causes mount-time warnings that trigger test
failures unless we disable locking.

No DTrace NFS tests need locking, so disable it.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: f4356872853de232f0d960798718d98059e5f491
      https://github.com/oracle/dtrace-utils/commit/f4356872853de232f0d960798718d98059e5f491
  Author: Nick Alcock <nick.alcock at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    A test/unittest/preprocessor/err.defincomp.r.p
    A test/unittest/preprocessor/err.ifdefincomp.r.p
    A test/unittest/preprocessor/err.incompelse.r.p
    A test/unittest/preprocessor/err.mulelse.r.p

  Log Message:
  -----------
  test: preprocessor: work on GCC 16

GCC commit c397a8c12296b75a91ae51e4889debf023e6c338 ("libcpp, genmatch:
Use gcc_diag instead of printf for libcpp diagnostics") made libcpp
quote identifiers and tokens in diagnostics like the rest of GCC does.
We have several tests that rely on the old error formatting: sed away
quotes and smartquotes into quotes or nothing (as appropriate to match
older GCCs), until such time as GCC 15 is obsolete (a long long time
away).

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: bdc487dd7bfcec35b99741b090b55e8bb5ac823e
      https://github.com/oracle/dtrace-utils/commit/bdc487dd7bfcec35b99741b090b55e8bb5ac823e
  Author: Nick Alcock <nick.alcock at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M test/unittest/builtinvar/tst.tid_pid.sh

  Log Message:
  -----------
  test: tid_pid: don't assume the type of pthread_t

GCC 16 warns about this mismatch.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 49e64618322345f7220dc7187a7349fd30964c92
      https://github.com/oracle/dtrace-utils/commit/49e64618322345f7220dc7187a7349fd30964c92
  Author: Nick Alcock <nick.alcock at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M test/unittest/types/err.D_UNKNOWN.dupstruct.r
    M test/utils/libctf.r.p

  Log Message:
  -----------
  test: dupstruct: fix extra duplicate identifier case

We were failing to handle one case where duplicate members or variables
are now reported as duplicate members, enumerators, or variables.
(It was concealed inside an .r.p.)

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 944dac09592b53b5214b5f6978204da4b44fff9d
      https://github.com/oracle/dtrace-utils/commit/944dac09592b53b5214b5f6978204da4b44fff9d
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    R test/unittest/enum/err.D_DECL_IDRED.RepeatIdentifiers.d
    R test/unittest/enum/err.D_DECL_IDRED.RepeatIdentifiers.r
    R test/unittest/enum/err.D_DECL_IDRED.RepeatIdentifiers.r.p
    A test/unittest/enum/err.RepeatIdentifiers.d
    A test/unittest/enum/err.RepeatIdentifiers.r
    A test/unittest/enum/err.RepeatIdentifiers.r.p
    R test/unittest/types/err.D_DECL_IDRED.dupenum.d
    R test/unittest/types/err.D_DECL_IDRED.dupenum.r
    R test/unittest/types/err.D_DECL_IDRED.dupenum.r.p
    A test/unittest/types/err.dupenum.d
    A test/unittest/types/err.dupenum.r
    A test/unittest/types/err.dupenum.r.p
    M test/utils/libctf.r.p

  Log Message:
  -----------
  test: Account for variations in error messages

Clearly,
    test/unittest/enum/err.*RepeatIdentifiers.d
    test/unittest/types/err.*dupenum.d
are impacted, but so are
    test/unittest/offsetof/err.D_UNKNOWN.OffsetofNULL.d
    test/unittest/types/err.D_UNKNOWN.dupstruct.d
    test/unittest/union/err.D_DECL_INCOMPLETE.circular.d
    test/unittest/union/err.D_DECL_INCOMPLETE.order.d
    test/unittest/union/err.D_DECL_INCOMPLETE.simple.d
due to symlinks to libctf.r.p.  And dupstruct needed a fix.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: bf23642faa29e212b114063f2e43f713ae54cc28
      https://github.com/oracle/dtrace-utils/commit/bf23642faa29e212b114063f2e43f713ae54cc28
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-10-09 (Thu, 09 Oct 2025)

  Changed paths:
    M test/stress/fbtsafety/tst.index.d
    M test/stress/fbtsafety/tst.strjoin.d
    M test/stress/fbtsafety/tst.strstr.d
    M test/stress/fbtsafety/tst.strtok.d
    M test/stress/fbtsafety/tst.substr.d
    M test/unittest/variables/bvar/tst.vtimestamp.d

  Log Message:
  -----------
  test: Modify fbtsafety tests that use vtimestamp unnecessarily

Currently, we do not implement vtimestamp.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: d0e1453a68042a4b80f645ff791bae658da68d1f
      https://github.com/oracle/dtrace-utils/commit/d0e1453a68042a4b80f645ff791bae658da68d1f
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-10-13 (Mon, 13 Oct 2025)

  Changed paths:
    M test/unittest/variables/bvar/tst.ustackdepth_big.sh

  Log Message:
  -----------
  test: Account for large stack-limit kernel parameter

In commit d0fdeec50 ("test: Fix some ustackdepth tests"), the test was
tweaked to check that the full stack would be recovered if the kernel
stack-limit parameter were increased from a default 127 to greater than
about 190 frames.  But this does not work if the system already has
reset the kernel parameter to a high value.

Change the test to deliberately try a "too small" and a "big enough"
value -- again, ultimately restoring the original value.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 29c01a51963c7773298f36eca9e7622a495b4bdb
      https://github.com/oracle/dtrace-utils/commit/29c01a51963c7773298f36eca9e7622a495b4bdb
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-10-13 (Mon, 13 Oct 2025)

  Changed paths:
    M test/utils/libctf.r.p

  Log Message:
  -----------
  test: Account again for variations in error messages

In commit 944dac095 ("test: Account for variations in error messages"),
an attempt was made to account for variations in error messages.

However, it was applied to the branch after commit 49e646183
("test: dupstruct: fix extra duplicate identifier case"), and conflict
resolution was not consistent.  The earlier patch "standardized"
messages by applying an optional "enumerator" where that label was
missing;  the subsequent patch did the opposite.  Subsequently, some
logic got messed up.

Fix up the logic.  In particular, standardize on the newer error
message (with the "enumerator" label).

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


Compare: https://github.com/oracle/dtrace-utils/compare/17efd07d1344...29c01a51963c

To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications



More information about the DTrace-devel mailing list