Command reference¶
This page lists every built-in sdb command, grouped by domain. Use
help <command> inside the REPL for full details and examples.
Core commands¶
These are defined in sdb/command.py and are always available.
Command |
Aliases |
Description |
|---|---|---|
address |
|
Resolve symbol names or hex addresses to drgn objects; can start a pipeline. |
cast |
Cast pipeline objects to a specified C type. |
|
deref |
Dereference pointer objects. |
|
walk |
Dispatch to the appropriate Walker based on input type. With no input, lists all registered walkers. |
General commands¶
Utility commands available for all target types.
Command |
Aliases |
Description |
|---|---|---|
echo |
|
Create |
member |
Access struct members using |
|
filter |
Filter objects by a Python expression ( |
|
pyfilter |
Alias / variant of filter with Python expressions. |
|
head |
Pass through only the first N objects. |
|
tail |
Pass through only the last N objects. |
|
count |
|
Count objects in the pipeline and emit the result. |
sum |
Sum integer values in the pipeline. |
|
type |
Print the drgn type of each input object. |
|
ptype |
Print the type definition (struct layout, enum values, etc.). |
|
sizeof |
Print the size of a type in bytes. |
|
container_of |
Given a pointer to a struct member, find the containing struct. |
|
array |
Index into array objects. |
|
Format output for scripts (machine-readable). |
||
pretty_print |
|
Pretty-print objects using the registered PrettyPrinter for their type. |
help |
|
Show help for a command. |
history |
Show REPL command history. |
|
exit |
|
Exit the REPL. |
Linux kernel commands¶
Available when debugging a kernel target (live or crash dump).
Threads and stacks¶
Command |
Aliases |
Description |
|---|---|---|
threads |
|
Locate and print kernel threads ( |
stacks |
|
Print aggregated stack traces for threads. Supports filtering by
state ( |
crashed_thread |
|
Print the thread that panicked (crash dumps only). |
trace |
|
Print a backtrace for a |
stackframe |
|
Select or print a stack frame for a task. |
locals |
|
Print local variables in the current stack frame. |
registers |
|
Print register values for a stack frame. |
Processes¶
Command |
Aliases |
Description |
|---|---|---|
find_task |
Find a |
|
pid |
Find a |
|
fget |
Get a |
Memory¶
Command |
Aliases |
Description |
|---|---|---|
slabs |
List slab caches ( |
|
slub_cache |
Walk objects in a SLUB slab cache. |
|
percpu |
Resolve a per-CPU pointer for a given CPU. |
|
cpu_counter_sum |
Sum a per-CPU counter across all CPUs. |
|
whatis |
Identify which kmem cache owns an address. |
Data structure walkers¶
Command |
Aliases |
Description |
|---|---|---|
linux_list |
|
Walk a |
linux_hlist |
|
Walk a |
rbtree |
Walk a red-black tree. |
System¶
Command |
Aliases |
Description |
|---|---|---|
dmesg |
Print the kernel log buffer. |
ZFS commands¶
Available when the ZFS kernel module is loaded.
Command |
Aliases |
Description |
|---|---|---|
spa |
Locate and pretty-print SPA (Storage Pool Allocator) objects. |
|
vdev |
Walk and pretty-print vdevs in a pool. |
|
metaslab |
Walk metaslabs for a vdev. |
|
zio |
Iterate and pretty-print ZIO (ZFS I/O) objects. |
|
dbuf |
Iterate and pretty-print dbufs (DMU buffers). |
|
arc |
Print ARC (Adaptive Replacement Cache) statistics. |
|
zfs_btree |
Walk a ZFS B-tree. |
|
blkptr |
Pretty-print a ZFS block pointer. |
|
range_tree |
Pretty-print a range tree. |
|
range_seg |
Locate range segments from a range tree. |
|
zfs_histogram |
|
Print a ZFS histogram and its median. |
zfs_dbgmsg |
Print ZFS debug messages. |
SPL commands¶
Commands for the Solaris Porting Layer data structures.
Command |
Aliases |
Description |
|---|---|---|
avl |
Walk an AVL tree ( |
|
spl_list |
Walk an SPL |
|
multilist |
Walk a multilist. |
|
spl_kmem_caches |
List SPL kmem caches. |
|
spl_cache |
Walk objects in an SPL kmem cache. |
Meta-commands¶
Meta-commands are prefixed with % and control the REPL itself rather
than operating on drgn objects.
Command |
Description |
|---|---|
|
Load external sdb commands from a file or directory. |
|
Start recording memory accesses to |
|
Stop recording and save the vmcore. |
|
Show recording/replay status and statistics. |
|
Configure output format and compression. |
|
Capture an object’s memory into the recording. |
|
Capture a raw memory region into the recording. |
|
Hint to use |