Skip to contentSkip to conversation

Followup on doc issues with USDT

DISCUSSION Sam James 1 participant 1 message Aug 21, 2024

lore
Share & tools
lore

Sam James

author
#0 lore raw

Hi!

This is a followup to
https://lore.kernel.org/dtrace/[email protected]/.

Carrying on with the USDT tutorial and reference, I noticed a few other issues.

* In the guide/reference [0], under "Adding Probes to an Application" -> "Using Statically Defined Probes", a script is provided as 'testscript'.

Unfortunately, the script is broken (it's missing a heredoc for the Makefile at the very least; there's nothing in the script to stsrt creating a Makefile, it just launches into some of its (truncated) contents):

```
$ bash /tmp/x
/tmp/x: line 36: test.o:: command not found
test.c:2:10: fatal error: prov.h: No such file or directory
    2 | #include "prov.h"
      |          ^~~~~~~~
compilation terminated.
/tmp/x: line 39: prov.o:: command not found
dtrace: failed to link script prov: failed to open test.o: No such file or directory
/tmp/x: line 42: test:: command not found
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find prov.o: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find test.o: No such file or directory
collect2: error: ld returned 1 exit status
/tmp/x: line 44: EOF: command not found
cc     test.c   -o test
test.c:2:10: fatal error: prov.h: No such file or directory
    2 | #include "prov.h"
      |          ^~~~~~~~
compilation terminated.
make: *** [<builtin>: test] Error 1
dtrace: No such process
```

* In the tutorial [1], under "Using USDT Probes", the 'list the probes' instructions don't work.

I get the same "No probe matches description" even when prime is certainly running in another terminal. I've also verified USDT functionality works using the DTrace testsuite and via manually constructing examples with an actual probe enabled (not just listing).

```
# dtrace -l -P 'prime*'
  ID   PROVIDER            MODULE                          FUNCTION NAME
dtrace: failed to match prime*:::: No probe matches description
```

When doing dtrace -l, it doesn't know to wildcard match USDT (or pid) probes.

[0] https://docs.oracle.com/en/operating-systems/oracle-linux/dtrace-guide/dtrace-ref-StaticallyDefinedTracingofUserApplications.html#dt_uusdt_sdt
[1] https://docs.oracle.com/en/operating-systems/oracle-linux/dtrace-tutorial/dtrace-tutorial-TracingUserSpaceApplications.html#dtrace_use_usdtprobes

thanks,
sam