6 drgn Command Reference

This table provides information about the drgn command.

Action Command Description

Start a Python shell to analyze the contents of the /proc/kcore live system image.

sudo drgn

Provides information for debugging the running live kernel.

Start a Python shell to analyze the contents of a different dump file for a running kernel or vmcore crash dump.

sudo drgn -c path/to/dumpfile

Provides information for debugging a running kernel or generated crash dump.

Start a Python shell to analyze the contents of a dump file and specify the vmlinux and module symbols.

sudo drgn -c path/to/dumpfile -s path/to/vmlinux

Provides information for debugging a running kernel, or generated crash dump, filtered by relevant kernel modules.

Review further options provided with the drgn command.

sudo drgn -h

Provides a listing of command line options for the drgn command.

Note:

Type exit() or press the Ctrl + D keys to exit the Python shell.

For example, to debug /proc/kcore for a live kernel and specify kernel drivers, run the following command:

sudo drgn  -c /proc/kcore -s /usr/lib/debug/lib/modules/$(uname -r)/vmlinux \
   -s /lib/modules/$(uname -r)/kernel/net/netfilter/xt_comment.ko.xz

To perform the same operation on a vmcore crash dump file:

sudo drgn -c /var/crash/127.0.0.1-2023-06-02-09:33:07/vmcore \
 -s /usr/lib/debug/lib/modules/5.15.0-101.103.2.1.el8uek.x86_64/vmlinux \
 -s /lib/modules/5.15.0-101.103.2.1.el8uek.x86_64/kernel/net/netfilter/xt_comment.ko.xz