drgn 0.0.25
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 withdrgn.set_default_prog()
anddrgn.get_default_prog()
. drgn.stack_trace()
was added as a shortcut fordrgn.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()
andfor_each_vma()
helpers were added todrgn.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 astruct cpumask *
to a CPU list string. Contributed by Imran Khan. cpu_online_mask()
,cpu_possible_mask()
, andcpu_present_mask()
helpers were added todrgn.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
- The
drgn.helpers.linux.slab
helpers were updated to handle kernels withCONFIG_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()
anddrgn.program_from_core_dump()
now accept a file descriptor. Contributed by Stephen Brennan.
Backwards-incompatible changes:
- The
allow_negative
parameter ofdrgn.helpers.linux.fs.path_lookup()
, and thesrc
,dst
, andfstype
parameters ofdrgn.helpers.linux.fs.for_each_mount()
anddrgn.helpers.linux.fs.print_mounts()
are all now keyword-only. This was necessary to allow omitting theprog
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()
anddrgn.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()
andenviron()
helpers indrgn.helpers.linux.mm
now returnNone
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 astruct 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+.