[DTrace-devel] [PATCH 08/20] doc: Fix anchor links for built-in variables

eugene.loh at oracle.com eugene.loh at oracle.com
Fri Sep 26 19:05:45 UTC 2025


From: Eugene Loh <eugene.loh at oracle.com>

Anchor links (links pointing to specific locations within files) are
broken, at least for viewing the Markdown User Guide in github from
Chrome and Edge, in at least two respects:

*)  The arcane ID names are displayed at the anchor sites.

*)  The links do not point to the specific locations within the files.

Remove the {#ID} tags and have the links point to the names that are
generated by default at the anchor sites.

This patch addresses the documentation on built-in variables.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 doc/userguide/index.md                        | 56 +++++++++----------
 .../dtrace_builtin_variable_reference.md      | 56 +++++++++----------
 2 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/doc/userguide/index.md b/doc/userguide/index.md
index a8f6a7e76..68d1164f8 100644
--- a/doc/userguide/index.md
+++ b/doc/userguide/index.md
@@ -76,34 +76,34 @@
     -   [Dynamic Runtime Options](reference/dynamic_runtime_options.md)
 -   [DTrace Stability Reference](reference/dt_stability_reference.md)
 -   [DTrace Built-in Variable Reference](reference/dtrace_builtin_variable_reference.md)
-    -   [Macro Variables](reference/dtrace_builtin_variable_reference.md#dt_macrov_scrpt)
-    -   [args\[\]](reference/dtrace_builtin_variable_reference.md#dt_ref_vars_args)
-    -   [arg0, …, arg9](reference/dtrace_builtin_variable_reference.md#dt_ref_var_arg0-9)
-    -   [caller](reference/dtrace_builtin_variable_reference.md#dt_ref_var_caller)
-    -   [curcpu](reference/dtrace_builtin_variable_reference.md#dt_ref_var_curcpu)
-    -   [curthread](reference/dtrace_builtin_variable_reference.md#dt_ref_var_curthread)
-    -   [epid](reference/dtrace_builtin_variable_reference.md#dt_ref_var_epid)
-    -   [errno](reference/dtrace_builtin_variable_reference.md#dt_ref_var_errno)
-    -   [execname](reference/dtrace_builtin_variable_reference.md#dt_ref_var_execname)
-    -   [fds](reference/dtrace_builtin_variable_reference.md#dt_ref_var_fds)
-    -   [gid](reference/dtrace_builtin_variable_reference.md#dt_ref_var_gid)
-    -   [id](reference/dtrace_builtin_variable_reference.md#dt_ref_var_id)
-    -   [ipl](reference/dtrace_builtin_variable_reference.md#dt_ref_var_ipl)
-    -   [pid](reference/dtrace_builtin_variable_reference.md#dt_ref_var_pid)
-    -   [ppid](reference/dtrace_builtin_variable_reference.md#dt_ref_var_ppid)
-    -   [probefunc](reference/dtrace_builtin_variable_reference.md#dt_ref_var_probefunc)
-    -   [probemod](reference/dtrace_builtin_variable_reference.md#dt_ref_var_probemod)
-    -   [probename](reference/dtrace_builtin_variable_reference.md#dt_ref_var_probename)
-    -   [probeprov](reference/dtrace_builtin_variable_reference.md#dt_ref_var_probeprov)
-    -   [stackdepth](reference/dtrace_builtin_variable_reference.md#dt_ref_var_stackdepth)
-    -   [tid](reference/dtrace_builtin_variable_reference.md#dt_ref_var_tid)
-    -   [timestamp](reference/dtrace_builtin_variable_reference.md#dt_ref_var_timestamp)
-    -   [ucaller](reference/dtrace_builtin_variable_reference.md#dt_ref_var_ucaller)
-    -   [uid](reference/dtrace_builtin_variable_reference.md#dt_ref_var_uid)
-    -   [uregs](reference/dtrace_builtin_variable_reference.md#dt_ref_var_uregs)
-    -   [ustackdepth](reference/dtrace_builtin_variable_reference.md#dt_ref_var_ustackdepth)
-    -   [vtimestamp](reference/dtrace_builtin_variable_reference.md#dt_ref_var_vtimestamp)
-    -   [walltimestamp](reference/dtrace_builtin_variable_reference.md#dt_ref_var_walltimestamp)
+    -   [Macro Variables](reference/dtrace_builtin_variable_reference.md#macro-variables)
+    -   [args\[\]](reference/dtrace_builtin_variable_reference.md#args)
+    -   [arg0, …, arg9](reference/dtrace_builtin_variable_reference.md#arg0--arg9)
+    -   [caller](reference/dtrace_builtin_variable_reference.md#caller)
+    -   [curcpu](reference/dtrace_builtin_variable_reference.md#curcpu)
+    -   [curthread](reference/dtrace_builtin_variable_reference.md#curthread)
+    -   [epid](reference/dtrace_builtin_variable_reference.md#epid)
+    -   [errno](reference/dtrace_builtin_variable_reference.md#errno)
+    -   [execname](reference/dtrace_builtin_variable_reference.md#execname)
+    -   [fds](reference/dtrace_builtin_variable_reference.md#fds)
+    -   [gid](reference/dtrace_builtin_variable_reference.md#gid)
+    -   [id](reference/dtrace_builtin_variable_reference.md#id)
+    -   [ipl](reference/dtrace_builtin_variable_reference.md#ipl)
+    -   [pid](reference/dtrace_builtin_variable_reference.md#pid)
+    -   [ppid](reference/dtrace_builtin_variable_reference.md#ppid)
+    -   [probefunc](reference/dtrace_builtin_variable_reference.md#probefunc)
+    -   [probemod](reference/dtrace_builtin_variable_reference.md#probemod)
+    -   [probename](reference/dtrace_builtin_variable_reference.md#probename)
+    -   [probeprov](reference/dtrace_builtin_variable_reference.md#probeprov)
+    -   [stackdepth](reference/dtrace_builtin_variable_reference.md#stackdepth)
+    -   [tid](reference/dtrace_builtin_variable_reference.md#tid)
+    -   [timestamp](reference/dtrace_builtin_variable_reference.md#timestamp)
+    -   [ucaller](reference/dtrace_builtin_variable_reference.md#ucaller)
+    -   [uid](reference/dtrace_builtin_variable_reference.md#uid)
+    -   [uregs](reference/dtrace_builtin_variable_reference.md#uregs)
+    -   [ustackdepth](reference/dtrace_builtin_variable_reference.md#ustackdepth)
+    -   [vtimestamp](reference/dtrace_builtin_variable_reference.md#vtimestamp)
+    -   [walltimestamp](reference/dtrace_builtin_variable_reference.md#walltimestamp)
 -   [DTrace Function Reference](reference/dtrace_functions.md)
     -   [Default Action](reference/dtrace-ref-DefaultAction.md)
     -   [Unimplemented Functions](reference/unimplemented_functions.md)
diff --git a/doc/userguide/reference/dtrace_builtin_variable_reference.md b/doc/userguide/reference/dtrace_builtin_variable_reference.md
index 3ecc55440..fd1af0f75 100644
--- a/doc/userguide/reference/dtrace_builtin_variable_reference.md
+++ b/doc/userguide/reference/dtrace_builtin_variable_reference.md
@@ -3,7 +3,7 @@
 
 DTrace includes a set of built-in scalar variables that can be used in D programs or scripts.
 
-## Macro Variables {#dt_macrov_scrpt}
+## Macro Variables
 
 Macro variables are variables that are populated at runtime and identify information about the running `dtrace` process or the process running the compiler.
 
@@ -243,7 +243,7 @@ To find the number of system calls made by the `date` command, save the script i
 sudo dtrace -s syscall.d -c date
 ```
 
-## args\[\] {#dt_ref_vars_args}
+## args\[\]
 
 The typed and mapped arguments, if any, to the current probe. The `args[]` array is accessed using an integer index. Use `dtrace -l -v` and check `Argument Types` for the type of each argument of each probe. For example, consider the system call `prlimit()`. The prototype on its `man` page \(`man -s 2 prlimit`\) is consistent with its DTrace probe listing \(`dtrace -lvn 'syscall:vmlinux:prlimit*:entry' | grep args`\). Specifically, argument 2, if non NULL, points to a `struct rlimit` with the requested resource limit, which can be traced with:
 
@@ -255,7 +255,7 @@ syscall:vmlinux:prlimit*:entry
 }
 ```
 
-## arg0, …, arg9 {#dt_ref_var_arg0-9}
+## arg0, …, arg9
 
 ```
 int64_t arg0, ..., arg9
@@ -271,7 +271,7 @@ rawfbt:vmlinux:ksys_write:entry
 }
 ```
 
-## caller {#dt_ref_var_caller}
+## caller
 
 ```
 uintptr_t caller
@@ -279,7 +279,7 @@ uintptr_t caller
 
 The built-in variable `caller` references the program counter location of the current kernel thread at the time the probe fired.
 
-## curcpu {#dt_ref_var_curcpu}
+## curcpu
 
 ```
 cpuinfo_t * curcpu
@@ -287,7 +287,7 @@ cpuinfo_t * curcpu
 
 The built-in variable `curcpu` references the current physical CPU.
 
-## curthread {#dt_ref_var_curthread}
+## curthread
 
 ```
 vmlinux`struct task_struct * curthread
@@ -295,7 +295,7 @@ vmlinux`struct task_struct * curthread
 
 The built-in variable `curthread` references a `vmlinux` data type, for which members can be found by searching for "task\_struct" on the Internet.
 
-## epid {#dt_ref_var_epid}
+## epid
 
 ```
 uint_t epid
@@ -306,12 +306,12 @@ The built-in variable `epid` references the enabled probe ID \(EPID\) for the cu
 ## errno
 
 ```
-int errno {#dt_ref_var_errno}
+int errno
 ```
 
 The built-in variable `errno` references the error value returned by the last system call run by this thread.
 
-## execname {#dt_ref_var_execname}
+## execname
 
 ```
 string execname
@@ -319,7 +319,7 @@ string execname
 
 The built-in variable `execname` references the name that was passed to `execve()` to run the current process.
 
-## fds {#dt_ref_var_fds}
+## fds
 
 ```
 fileinfo_t fds[]
@@ -327,7 +327,7 @@ fileinfo_t fds[]
 
 The built-in `variable fds[]` is an array which has the files the current process has opened in a `fileinfo_t` array, indexed by file descriptor number. See [fileinfo\_t](dtrace_providers_io.md).
 
-## gid {#dt_ref_var_gid}
+## gid
 
 ```
 gid_t gid
@@ -335,7 +335,7 @@ gid_t gid
 
 The built-in variable `gid` references the real group ID of the current process.
 
-## id {#dt_ref_var_id}
+## id
 
 ```
 uint_t id
@@ -343,7 +343,7 @@ uint_t id
 
 The built-in variable `id` references the probe ID for the current probe. This ID is the system-wide unique identifier for the probe, as published by DTrace and listed in the output of `dtrace -l`.
 
-## ipl {#dt_ref_var_ipl}
+## ipl
 
 ```
 uint_t ipl
@@ -355,7 +355,7 @@ The built-in variable `ipl` references the interrupt priority level \(IPL\) on t
 
 This value is non-zero if interrupts are firing and zero otherwise. The non-zero value depends on whether preemption is active, and other factors, and can vary between kernel releases and kernel configurations.
 
-## pid {#dt_ref_var_pid}
+## pid
 
 ```
 pid_t pid
@@ -363,7 +363,7 @@ pid_t pid
 
 The built-in variable `pid` references the process ID of the current process.
 
-## ppid {#dt_ref_var_ppid}
+## ppid
 
 ```
 pid_t ppid
@@ -371,7 +371,7 @@ pid_t ppid
 
 The built-in variable `ppid` references the parent process ID of the current process.
 
-## probefunc {#dt_ref_var_probefunc}
+## probefunc
 
 ```
 string probefunc
@@ -379,7 +379,7 @@ string probefunc
 
 The built-in variable `probefunc` references the function name part of the current probe's description.
 
-## probemod {#dt_ref_var_probemod}
+## probemod
 
 ```
 string probemod
@@ -387,7 +387,7 @@ string probemod
 
 The built-in variable `probemod` references the module name part of the current probe's description.
 
-## probename {#dt_ref_var_probename}
+## probename
 
 ```
 string probename
@@ -395,7 +395,7 @@ string probename
 
 The built-in variable `probename` references the name part of the current probe's description.
 
-## probeprov {#dt_ref_var_probeprov}
+## probeprov
 
 ```
 string probeprov
@@ -403,7 +403,7 @@ string probeprov
 
 The built-in variable `probeprov` references the provider name part of the current probe's description.
 
-## stackdepth {#dt_ref_var_stackdepth}
+## stackdepth
 
 ```
 uint32_t stackdepth
@@ -411,7 +411,7 @@ uint32_t stackdepth
 
 The built-in variable `stackdepth` references the current thread's stack frame depth at probe firing time.
 
-## tid {#dt_ref_var_tid}
+## tid
 
 ```
 id_t tid
@@ -419,7 +419,7 @@ id_t tid
 
 The built-in variable `tid` references the thread ID of the current thread.
 
-## timestamp {#dt_ref_var_timestamp}
+## timestamp
 
 ```
 uint64_t timestamp
@@ -427,7 +427,7 @@ uint64_t timestamp
 
 The built-in variable `timestamp` references the current value of a nanosecond timestamp counter. This counter increments from an arbitrary point in the past. Therefore, only use the timestamp counter for relative computations.
 
-## ucaller {#dt_ref_var_ucaller}
+## ucaller
 
 ```
 uint64_t ucaller
@@ -435,7 +435,7 @@ uint64_t ucaller
 
 The built-in variable `ucaller` references the program counter location of the current user thread at the time the probe fired.
 
-## uid {#dt_ref_var_uid}
+## uid
 
 ```
 uid_t uid
@@ -443,7 +443,7 @@ uid_t uid
 
 The built-in variable `uid` references the real user ID of the current process.
 
-## uregs {#dt_ref_var_uregs}
+## uregs
 
 ```
 uint64_t uregs[]
@@ -451,7 +451,7 @@ uint64_t uregs[]
 
 The current thread's saved user-mode register values at probe firing time.
 
-## ustackdepth {#dt_ref_var_ustackdepth}
+## ustackdepth
 
 ```
 uint32_t ustackdepth
@@ -459,7 +459,7 @@ uint32_t ustackdepth
 
 The built-in variable `ustackdepth` references the user thread's stack frame depth at probe firing time.
 
-## vtimestamp {#dt_ref_var_vtimestamp}
+## vtimestamp
 
 ```
 uint64_t vtimestamp
@@ -467,7 +467,7 @@ uint64_t vtimestamp
 
 The built-in variable `vtimestamp` references the current value of a nanosecond timestamp counter that's virtualized to the amount of time that the current thread has been running on a CPU, minus the time spent in DTrace predicates and functions. This counter increments from an arbitrary point in the past. Therefore, only use the vtimestamp counter for relative time computations.
 
-## walltimestamp {#dt_ref_var_walltimestamp}
+## walltimestamp
 
 ```
 int64_t walltimestamp
-- 
2.47.3




More information about the DTrace-devel mailing list