You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
DTrace includes a set of built-in scalar variables that can be used in D programs or scripts.
5
5
6
-
## Macro Variables {#dt_macrov_scrpt}
6
+
## Macro Variables <aid="dt_macrov_scrpt">
7
7
8
8
Macro variables are variables that are populated at runtime and identify information about the running `dtrace` process or the process running the compiler.
9
9
@@ -169,7 +169,7 @@ However, in probe descriptions, macro variables are expanded and concatenated wi
169
169
170
170
Macro variables are only expanded one time within each probe description field and they can't contain probe description delimiters \(`:`\).
171
171
172
-
### Macro Arguments {#dt_macroa_scrpt}
172
+
### Macro Arguments <aid="dt_macroa_scrpt">
173
173
174
174
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.
175
175
@@ -243,7 +243,7 @@ To find the number of system calls made by the `date` command, save the script i
243
243
sudo dtrace -s syscall.d -c date
244
244
```
245
245
246
-
## args\[\]{#dt_ref_vars_args}
246
+
## args\[\]<aid="dt_ref_vars_args">
247
247
248
248
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:
The built-in variable `caller` references the program counter location of the current kernel thread at the time the probe fired.
281
281
282
-
## curcpu {#dt_ref_var_curcpu}
282
+
## curcpu <aid="dt_ref_var_curcpu">
283
283
284
284
```
285
285
cpuinfo_t * curcpu
286
286
```
287
287
288
288
The built-in variable `curcpu` references the current physical CPU.
289
289
290
-
## curthread {#dt_ref_var_curthread}
290
+
## curthread <aid="dt_ref_var_curthread">
291
291
292
292
```
293
293
vmlinux`struct task_struct * curthread
294
294
```
295
295
296
296
The built-in variable `curthread` references a `vmlinux` data type, for which members can be found by searching for "task\_struct" on the Internet.
297
297
298
-
## epid {#dt_ref_var_epid}
298
+
## epid <aid="dt_ref_var_epid">
299
299
300
300
```
301
301
uint_t epid
@@ -306,44 +306,44 @@ The built-in variable `epid` references the enabled probe ID \(EPID\) for the cu
306
306
## errno
307
307
308
308
```
309
-
int errno {#dt_ref_var_errno}
309
+
int errno <a id="dt_ref_var_errno">
310
310
```
311
311
312
312
The built-in variable `errno` references the error value returned by the last system call run by this thread.
313
313
314
-
## execname {#dt_ref_var_execname}
314
+
## execname <aid="dt_ref_var_execname">
315
315
316
316
```
317
317
string execname
318
318
```
319
319
320
320
The built-in variable `execname` references the name that was passed to `execve()` to run the current process.
321
321
322
-
## fds {#dt_ref_var_fds}
322
+
## fds <aid="dt_ref_var_fds">
323
323
324
324
```
325
325
fileinfo_t fds[]
326
326
```
327
327
328
328
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).
329
329
330
-
## gid {#dt_ref_var_gid}
330
+
## gid <aid="dt_ref_var_gid">
331
331
332
332
```
333
333
gid_t gid
334
334
```
335
335
336
336
The built-in variable `gid` references the real group ID of the current process.
337
337
338
-
## id {#dt_ref_var_id}
338
+
## id <aid="dt_ref_var_id">
339
339
340
340
```
341
341
uint_t id
342
342
```
343
343
344
344
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`.
345
345
346
-
## ipl {#dt_ref_var_ipl}
346
+
## ipl <aid="dt_ref_var_ipl">
347
347
348
348
```
349
349
uint_t ipl
@@ -355,119 +355,119 @@ The built-in variable `ipl` references the interrupt priority level \(IPL\) on t
355
355
356
356
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.
357
357
358
-
## pid {#dt_ref_var_pid}
358
+
## pid <aid="dt_ref_var_pid">
359
359
360
360
```
361
361
pid_t pid
362
362
```
363
363
364
364
The built-in variable `pid` references the process ID of the current process.
365
365
366
-
## ppid {#dt_ref_var_ppid}
366
+
## ppid <aid="dt_ref_var_ppid">
367
367
368
368
```
369
369
pid_t ppid
370
370
```
371
371
372
372
The built-in variable `ppid` references the parent process ID of the current process.
373
373
374
-
## probefunc {#dt_ref_var_probefunc}
374
+
## probefunc <aid="dt_ref_var_probefunc">
375
375
376
376
```
377
377
string probefunc
378
378
```
379
379
380
380
The built-in variable `probefunc` references the function name part of the current probe's description.
381
381
382
-
## probemod {#dt_ref_var_probemod}
382
+
## probemod <aid="dt_ref_var_probemod">
383
383
384
384
```
385
385
string probemod
386
386
```
387
387
388
388
The built-in variable `probemod` references the module name part of the current probe's description.
389
389
390
-
## probename {#dt_ref_var_probename}
390
+
## probename <aid="dt_ref_var_probename">
391
391
392
392
```
393
393
string probename
394
394
```
395
395
396
396
The built-in variable `probename` references the name part of the current probe's description.
397
397
398
-
## probeprov {#dt_ref_var_probeprov}
398
+
## probeprov <aid="dt_ref_var_probeprov">
399
399
400
400
```
401
401
string probeprov
402
402
```
403
403
404
404
The built-in variable `probeprov` references the provider name part of the current probe's description.
405
405
406
-
## stackdepth {#dt_ref_var_stackdepth}
406
+
## stackdepth <aid="dt_ref_var_stackdepth">
407
407
408
408
```
409
409
uint32_t stackdepth
410
410
```
411
411
412
412
The built-in variable `stackdepth` references the current thread's stack frame depth at probe firing time.
413
413
414
-
## tid {#dt_ref_var_tid}
414
+
## tid <aid="dt_ref_var_tid">
415
415
416
416
```
417
417
id_t tid
418
418
```
419
419
420
420
The built-in variable `tid` references the thread ID of the current thread.
421
421
422
-
## timestamp {#dt_ref_var_timestamp}
422
+
## timestamp <aid="dt_ref_var_timestamp">
423
423
424
424
```
425
425
uint64_t timestamp
426
426
```
427
427
428
428
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.
429
429
430
-
## ucaller {#dt_ref_var_ucaller}
430
+
## ucaller <aid="dt_ref_var_ucaller">
431
431
432
432
```
433
433
uint64_t ucaller
434
434
```
435
435
436
436
The built-in variable `ucaller` references the program counter location of the current user thread at the time the probe fired.
437
437
438
-
## uid {#dt_ref_var_uid}
438
+
## uid <aid="dt_ref_var_uid">
439
439
440
440
```
441
441
uid_t uid
442
442
```
443
443
444
444
The built-in variable `uid` references the real user ID of the current process.
445
445
446
-
## uregs {#dt_ref_var_uregs}
446
+
## uregs <aid="dt_ref_var_uregs">
447
447
448
448
```
449
449
uint64_t uregs[]
450
450
```
451
451
452
452
The current thread's saved user-mode register values at probe firing time.
453
453
454
-
## ustackdepth {#dt_ref_var_ustackdepth}
454
+
## ustackdepth <aid="dt_ref_var_ustackdepth">
455
455
456
456
```
457
457
uint32_t ustackdepth
458
458
```
459
459
460
460
The built-in variable `ustackdepth` references the user thread's stack frame depth at probe firing time.
461
461
462
-
## vtimestamp {#dt_ref_var_vtimestamp}
462
+
## vtimestamp <aid="dt_ref_var_vtimestamp">
463
463
464
464
```
465
465
uint64_t vtimestamp
466
466
```
467
467
468
468
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.
0 commit comments