Skip to content

drgn 0.0.25

Compare
Choose a tag to compare
@osandov osandov released this 01 Dec 22:26
· 341 commits to main since this release

This release adds some usability improvements, lots of new helpers, fixes for stack traces from exotic core dumps, and more.

New features:

  • The prog argument can now be omitted from most function calls in the CLI. Library users can configure the same behavior with drgn.set_default_prog() and drgn.get_default_prog().
  • drgn.stack_trace() was added as a shortcut for drgn.Program.stack_trace().
  • drgn can now be run against the live kernel as a non-root user. It uses sudo to open /proc/kcore. Contributed by Stephen Brennan.
  • Helpers for the Linux kernel's maple tree data structure were added in drgn.helpers.linux.maple.
  • vma_find() and for_each_vma() helpers were added to drgn.helpers.linux.mm. They look up or iterate over virtual memory areas in an address space, respectively.
  • Helpers for Linux kernel wait queues were added in drgn.helpers.linux.wait. Contributed by Imran Khan.
  • The drgn.helpers.linux.cpumask.cpumask_to_cpulist() helper was added. It converts a struct cpumask * to a CPU list string. Contributed by Imran Khan.
  • cpu_online_mask(), cpu_possible_mask(), and cpu_present_mask() helpers were added to drgn.helpers.linux.cpumask.
  • Support for Linux 6.6 and 6.7 was added.
    • The drgn.helpers.linux.mm.compound_order() helper was updated for Linux 6.6.
    • The drgn.Program.threads() iterator was updated for Linux 6.7.
  • The drgn.helpers.linux.slab helpers were updated to handle kernels with CONFIG_SLUB_TINY enabled.
  • The compound page helpers in drgn.helpers.linux.mm were updated to handle the RHEL 7 kernel. Contributed by Oleksandr Natalenko.
  • Virtual address translation support was added for ppc64. Contributed by Sourabh Jain.
  • drgn now supports the flattened kdump format when built with libkdumpfile support. Contributed by Petr Tesarik.
  • drgn.Program.set_core_dump() and drgn.program_from_core_dump() now accept a file descriptor. Contributed by Stephen Brennan.

Backwards-incompatible changes:

  • The allow_negative parameter of drgn.helpers.linux.fs.path_lookup(), and the src, dst, and fstype parameters of drgn.helpers.linux.fs.for_each_mount() and drgn.helpers.linux.fs.print_mounts() are all now keyword-only. This was necessary to allow omitting the prog argument without ambiguity.
  • Type hints are no longer supported for Python 3.6 and Python 3.7. Those Python versions are still supported at runtime.

Bug fixes:

  • Stack traces were fixed for core dumps from QEMU's dump-guest-memory command, ppc64 vmcores on Linux 6.5+ (and recent stable kernels), and s390x vmcores.
  • Type annotations and documentation for drgn.Program.add_type_finder() and drgn.Program.add_object_finder() were corrected. Contributed by Stephen Brennan.
  • Relocations for 32-bit Arm and x86 were fixed to use drgn's own implementation as intended instead of libdwfl's. This is mainly a performance improvement.

Other improvements:

  • The cmdline() and environ() helpers in drgn.helpers.linux.mm now return None for kernel threads instead of raising an exception. Contributed by Peter Collingbourne.
  • AArch64 virtual address translation was optimized to only read the minimum amount of page table data. Contributed by Peter Collingbourne.
  • The warning when debugging symbols are not found now includes a link to the drgn documentation for how to get debugging symbols. Contributed by Alex Gartrell.
  • The documentation for C operator equivalents was improved.

contrib directory:

  • contrib/find_struct_file.py was added. It looks for references to a struct file *.
  • contrib/stack_trace_call_fault.py was added. It manually unwinds a stack trace from a call to an invalid address on x86-64.
  • contrib/irq.py was added. It prints out IRQs, their affinities, and statistics. Contributed by Imran Khan.
  • contrib/vmmap.py was updated to work on Linux 6.1+.