Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bbc780d

Browse files
committed
doc: Fix anchor links for built-in variables
Anchor links (links pointing to specific locations within files) are broken, at least for viewing the Markdown version of the DTrace User Guide on github from common browsers, 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. The problem is that the {#ID} syntax is not recognized. Replace the {#ID} tags with more universal HTML <a id="ID"> tags. This patch addresses the documentation on built-in variables. Signed-off-by: Eugene Loh <eugene.loh@oracle.com> Reviewed-by: Elena Zannoni <elena.zannoni@oracle.com>
1 parent f166980 commit bbc780d

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

‎doc/userguide/reference/dtrace_builtin_variable_reference.md‎

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

2-
# DTrace Built-in Variable Reference {#dt_ref_builtin_vars}
2+
# DTrace Built-in Variable Reference <aid="dt_ref_builtin_vars">
33

44
DTrace includes a set of built-in scalar variables that can be used in D programs or scripts.
55

6-
## Macro Variables {#dt_macrov_scrpt}
6+
## Macro Variables <aid="dt_macrov_scrpt">
77

88
Macro variables are variables that are populated at runtime and identify information about the running `dtrace` process or the process running the compiler.
99

@@ -169,7 +169,7 @@ However, in probe descriptions, macro variables are expanded and concatenated wi
169169

170170
Macro variables are only expanded one time within each probe description field and they can't contain probe description delimiters \(`:`\).
171171

172-
### Macro Arguments {#dt_macroa_scrpt}
172+
### Macro Arguments <aid="dt_macroa_scrpt">
173173

174174
The D compiler also provides a set of macro variables corresponding to any more argument operands that are specified as part of the `dtrace` command invocation. These *macro arguments* are accessed by using the built-in names `0ドル`, for the name of the D program file or `dtrace` command, `1ドル`, for the first extra operand, `2ドル` for the second operand, and so on. If you use the `-s` option, `0ドル` expands to the value of the name of the input file that's used with this option. For D programs that are specified on the command line, `0ドル` expands to the value of `argv[0]`, which is used to run the `dtrace` command itself.
175175

@@ -243,7 +243,7 @@ To find the number of system calls made by the `date` command, save the script i
243243
sudo dtrace -s syscall.d -c date
244244
```
245245

246-
## args\[\] {#dt_ref_vars_args}
246+
## args\[\] <aid="dt_ref_vars_args">
247247

248248
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:
249249

@@ -255,7 +255,7 @@ syscall:vmlinux:prlimit*:entry
255255
}
256256
```
257257

258-
## arg0, ..., arg9 {#dt_ref_var_arg0-9}
258+
## arg0, ..., arg9 <aid="dt_ref_var_arg0-9">
259259

260260
```
261261
int64_t arg0, ..., arg9
@@ -271,31 +271,31 @@ rawfbt:vmlinux:ksys_write:entry
271271
}
272272
```
273273

274-
## caller {#dt_ref_var_caller}
274+
## caller <aid="dt_ref_var_caller">
275275

276276
```
277277
uintptr_t caller
278278
```
279279

280280
The built-in variable `caller` references the program counter location of the current kernel thread at the time the probe fired.
281281

282-
## curcpu {#dt_ref_var_curcpu}
282+
## curcpu <aid="dt_ref_var_curcpu">
283283

284284
```
285285
cpuinfo_t * curcpu
286286
```
287287

288288
The built-in variable `curcpu` references the current physical CPU.
289289

290-
## curthread {#dt_ref_var_curthread}
290+
## curthread <aid="dt_ref_var_curthread">
291291

292292
```
293293
vmlinux`struct task_struct * curthread
294294
```
295295

296296
The built-in variable `curthread` references a `vmlinux` data type, for which members can be found by searching for "task\_struct" on the Internet.
297297

298-
## epid {#dt_ref_var_epid}
298+
## epid <aid="dt_ref_var_epid">
299299

300300
```
301301
uint_t epid
@@ -306,44 +306,44 @@ The built-in variable `epid` references the enabled probe ID \(EPID\) for the cu
306306
## errno
307307

308308
```
309-
int errno {#dt_ref_var_errno}
309+
int errno <a id="dt_ref_var_errno">
310310
```
311311

312312
The built-in variable `errno` references the error value returned by the last system call run by this thread.
313313

314-
## execname {#dt_ref_var_execname}
314+
## execname <aid="dt_ref_var_execname">
315315

316316
```
317317
string execname
318318
```
319319

320320
The built-in variable `execname` references the name that was passed to `execve()` to run the current process.
321321

322-
## fds {#dt_ref_var_fds}
322+
## fds <aid="dt_ref_var_fds">
323323

324324
```
325325
fileinfo_t fds[]
326326
```
327327

328328
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).
329329

330-
## gid {#dt_ref_var_gid}
330+
## gid <aid="dt_ref_var_gid">
331331

332332
```
333333
gid_t gid
334334
```
335335

336336
The built-in variable `gid` references the real group ID of the current process.
337337

338-
## id {#dt_ref_var_id}
338+
## id <aid="dt_ref_var_id">
339339

340340
```
341341
uint_t id
342342
```
343343

344344
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`.
345345

346-
## ipl {#dt_ref_var_ipl}
346+
## ipl <aid="dt_ref_var_ipl">
347347

348348
```
349349
uint_t ipl
@@ -355,119 +355,119 @@ The built-in variable `ipl` references the interrupt priority level \(IPL\) on t
355355

356356
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.
357357

358-
## pid {#dt_ref_var_pid}
358+
## pid <aid="dt_ref_var_pid">
359359

360360
```
361361
pid_t pid
362362
```
363363

364364
The built-in variable `pid` references the process ID of the current process.
365365

366-
## ppid {#dt_ref_var_ppid}
366+
## ppid <aid="dt_ref_var_ppid">
367367

368368
```
369369
pid_t ppid
370370
```
371371

372372
The built-in variable `ppid` references the parent process ID of the current process.
373373

374-
## probefunc {#dt_ref_var_probefunc}
374+
## probefunc <aid="dt_ref_var_probefunc">
375375

376376
```
377377
string probefunc
378378
```
379379

380380
The built-in variable `probefunc` references the function name part of the current probe's description.
381381

382-
## probemod {#dt_ref_var_probemod}
382+
## probemod <aid="dt_ref_var_probemod">
383383

384384
```
385385
string probemod
386386
```
387387

388388
The built-in variable `probemod` references the module name part of the current probe's description.
389389

390-
## probename {#dt_ref_var_probename}
390+
## probename <aid="dt_ref_var_probename">
391391

392392
```
393393
string probename
394394
```
395395

396396
The built-in variable `probename` references the name part of the current probe's description.
397397

398-
## probeprov {#dt_ref_var_probeprov}
398+
## probeprov <aid="dt_ref_var_probeprov">
399399

400400
```
401401
string probeprov
402402
```
403403

404404
The built-in variable `probeprov` references the provider name part of the current probe's description.
405405

406-
## stackdepth {#dt_ref_var_stackdepth}
406+
## stackdepth <aid="dt_ref_var_stackdepth">
407407

408408
```
409409
uint32_t stackdepth
410410
```
411411

412412
The built-in variable `stackdepth` references the current thread's stack frame depth at probe firing time.
413413

414-
## tid {#dt_ref_var_tid}
414+
## tid <aid="dt_ref_var_tid">
415415

416416
```
417417
id_t tid
418418
```
419419

420420
The built-in variable `tid` references the thread ID of the current thread.
421421

422-
## timestamp {#dt_ref_var_timestamp}
422+
## timestamp <aid="dt_ref_var_timestamp">
423423

424424
```
425425
uint64_t timestamp
426426
```
427427

428428
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.
429429

430-
## ucaller {#dt_ref_var_ucaller}
430+
## ucaller <aid="dt_ref_var_ucaller">
431431

432432
```
433433
uint64_t ucaller
434434
```
435435

436436
The built-in variable `ucaller` references the program counter location of the current user thread at the time the probe fired.
437437

438-
## uid {#dt_ref_var_uid}
438+
## uid <aid="dt_ref_var_uid">
439439

440440
```
441441
uid_t uid
442442
```
443443

444444
The built-in variable `uid` references the real user ID of the current process.
445445

446-
## uregs {#dt_ref_var_uregs}
446+
## uregs <aid="dt_ref_var_uregs">
447447

448448
```
449449
uint64_t uregs[]
450450
```
451451

452452
The current thread's saved user-mode register values at probe firing time.
453453

454-
## ustackdepth {#dt_ref_var_ustackdepth}
454+
## ustackdepth <aid="dt_ref_var_ustackdepth">
455455

456456
```
457457
uint32_t ustackdepth
458458
```
459459

460460
The built-in variable `ustackdepth` references the user thread's stack frame depth at probe firing time.
461461

462-
## vtimestamp {#dt_ref_var_vtimestamp}
462+
## vtimestamp <aid="dt_ref_var_vtimestamp">
463463

464464
```
465465
uint64_t vtimestamp
466466
```
467467

468468
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.
469469

470-
## walltimestamp {#dt_ref_var_walltimestamp}
470+
## walltimestamp <aid="dt_ref_var_walltimestamp">
471471

472472
```
473473
int64_t walltimestamp

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /