5 Getting Started With drgn

Debugging a live running kernel by using the drgn command.

Install the drgn package. For more information, see Installing drgn.

The drgn command can be used to troubleshoot system problems by analyzing the contents of system images and crash dumps.

  1. To debug the running kernel, use the drgn command to analyze the contents of the /proc/kcore live system image:
    drgn
  2. Type exit() or press the Ctrl + D keys to exit the Python shell.
  3. For more information about how to use the drgn command, use the -h option:
    drgn -h

A Python shell was started, provided access to live kernel debugging information, and was then stopped.

If a matching DebugInfo package isn't installed for the running kernel, you might see an error message. Drgn can still be used on a production system to debug a kernel dump that was generated by a separate development system that has DebugInfo packages installed.

Note:

Kernel dumps generated on systems without DebugInfo packages installed can be debugged by using the corelens command, as that uses Common Type Format (CTF) debug information when DWARF debug information isn't present. For more information, see Getting Started With corelens.