ITADN
osandov/drgn

版本发布 8

vmtest Compilersvmtest-compilers预发布
? · 2026-02-12

Cross-compilers mirrored from https://mirrors.kernel.org/pub/tools/crosstool/ for [vmtest](https://github.com/osandov/drgn/tree/main/vmtest). (This is a dummy GitHub release for storing assets, not a real release of drgn.)

drgn 0.0.32v0.0.32
? · 2025-06-18

This is a smaller release that mainly fixes a few important bugs and tweaks a couple of the APIs added in the last release. It also adds several new helpers and features. Note that this release was originally going to drop support for Python 3.6 and 3.7, but that was postponed by one release. This is the last release to support Python 3.6 and 3.7. New features: - Support for reading ELF symbols from [MiniDebugInfo](https://sourceware.org/gdb/current/onlinedocs/gdb.html/MiniDebugInfo.html) was added. This is commonly used on Fedora Linux and its derivatives. Contributed by Stephen Brennan. - The `is_pp_page()` helper was added to `drgn.helpers.linux.net`. It returns whether a page came from the page pool allocator. Contributed by Dragos Tatulea. - The `bitmap_weight()` helper was added to `drgn.helpers.linux.bitmap`. It returns the number of set bits in a bitmap. - The `cpumask_weight()`, `num_online_cpus()`, `num_possible_cpus()`, and `num_present_cpus()` helpers were added to `drgn.helpers.linux.cpumask`. They return the number of CPUs in a CPU mask. - The `drgn.helpers.linux.timekeeping` module was added. It contains helpers for getting monotonic, real, boot, and TAI timestamps in seconds (`ktime_get{,_real,_boottime,_clocktai}_seconds()`) and coarse nanoseconds (`ktime_get_coarse{,_real,_boottime,_clocktai}_ns()`). It also contains shortcuts for getting system uptime as a float (`uptime()`) or a human-readable string (`uptime_pretty()`). - The `print_table()` helper was added to `drgn.helpers.common.format`. It prints data formatted as an aligned table. - `drgn.execscript()` now accepts an optional dictionary of globals instead of always using the caller's globals. Contributed by Stephen Brennan. - Modules can now have multiple, discontiguous address ranges, represented in `drgn.Module.address_ranges`. `drgn.Module.address_range` is kept as an alias for modules with only one address range. - `tools/fsrefs.py` gained a new mode for finding references to a Btrfs subvolume. - Linux 6.16 is now supported. No updates were required. Incompatible changes: - The `drgn.DebugInfoOptions.directories` option has been split into two options. Previously, relative paths in `directories` had a special meaning and were only used for searches by debug link. Now, relative paths in `directories` do not have any special meaning (they are used relative to the current working directory). Instead, `debug_link_directories` is provided to control searches by debug link. This provides more predictable behavior for the `--debug-directory` command line option. * `drgn.Program.load_debug_info(main=True, default=False)` (and thus the `--main-symbols` command line option) now creates all loaded modules instead of just the main module. Contributed by Stephen Brennan. Bug fixes: - Symbols from data sections are now properly found in Linux kernel modules on Linux 6.4+. - A full ELF symbol table now overrides a partial symbol table that was found earlier. - An empty argument to the `-e` command line option now executes an empty statement instead of entering interactive mode. - The `drgn.helpers.linux.fs.for_each_mount()` helper now skips cursors (fake mount objects used between Linux 5.8 and 6.8). Contributed by Stephen Brennan. - Several reference leaks that leaked `drgn.Program` objects were fixed. Partially contributed by Stephen Brennan. - An out of bounds `memcpy()` in the `deserialize_struct64` test case was fixed on i386. Documentation: - Documentation of the tie-breaking behavior of symbol searches by address was clarified. - Bad formatting in a few code examples was fixed. `contrib` directory: - `contrib/pp_leak` was added. It contains a few scripts for finding page pool leaks, adapted from Dragos Tatulea's talk at Netdev 0x19. Contributed by Dragos Tatulea. Packaging changes: - drgn now optionally depends on liblzma for MiniDebugInfo support.

Tutorial Assetstutorial-assets预发布
? · 2025-02-08

This is a dummy GitHub release for storing assets, not a real release of drgn.

drgn 0.0.30v0.0.30
? · 2024-12-18

This release adds new APIs for providing symbol information to drgn, support for the new Python 3.13 REPL, and a few important bug fixes. New features: - The `drgn.SymbolIndex` class was added. It provides an efficient implementation of a symbol finder for a static list of symbols. Contributed by Stephen Brennan. - The `drgn.helpers.linux.kallsyms` module was added. It provides two helpers, `load_vmlinux_kallsyms()` and `load_module_kallsyms()`, that can be used to look up symbols without full debugging information. Contributed by Stephen Brennan. - The CLI will now use the enhanced REPL added in Python 3.13 when available. This greatly improves the user experience with multiline editing, colorized output, and more. Contributed by Stephen Brennan. - Linux 6.13 is now supported. No updates were required. Bug fixes: - Linux kernel stack traces now reliably continue through interrupt handlers as long as the kernel uses the ORC unwinder. - The `slab_cache_for_each_allocated_object()` and `slab_object_info()` helpers in `drgn.helpers.linux.slab` now report cycles in SLUB freelists instead of getting stuck in an infinite loop. - The `css_for_each_child()` and `css_for_each_descendant_pre()` helpers in `drgn.helpers.linux.cgroup` were fixed to include offlined css objects. Contributed by Michal Koutný. - The REPL now gracefully displays objects that cannot be read instead of failing with a `drgn.FaultError`. - A double reference count decrement in an error path of initializing the drgn Python bindings was fixed. Documentation: - Documentation for installing drgn on Arch Linux was updated now that drgn is officially packaged on Arch Linux. Contributed by Christian Heusel. - Documentation for installing drgn and debugging symbols on Oracle Linux was added. Contributed by Stephen Brennan. `contrib` directory: - `contrib/bpf_inspect.py` was fixed to handle Linux < 5.10 when printing BPF programs. Contributed by Ze Gao. - `contrib/cgroup.py` now has a `stat` subcommand for printing the number of online and dying css objects. Contributed by Michal Koutný. - `contrib/cgroup.py`'s `bpf` subcommand was fixed to not access an array out of bounds on Linux >= 5.15. - `contrib/ptdrgn.py` was fixed to gracefully display objects that cannot be read. Contributed by Stephen Brennan. Internal: - Many preparations were made for the upcoming module API. - The internal `drgndoc` Sphinx extension was fixed to handle deprecated `ast` nodes that were removed in Python 3.14.

drgn 0.0.29v0.0.29
? · 2024-10-08

This is a small release fixing the `call_function()`, `write_memory()`, and `write_object()` helpers in `drgn.helpers.experimental.kmodify` for kernels with `CONFIG_MODVERSIONS=y`.

drgn 0.0.28v0.0.28
? · 2024-10-07

New features: - The `drgn.helpers.experimental.kmodify` module was added. It provides helpers for modifying the running kernel, including calling arbitrary functions (`call_function()`) and writing to memory (`write_memory()`, `write_object()`). - Virtual address translation and stack trace support for 32-bit Arm were added. - The `drgn.implicit_convert()` function was added. It converts an object to a type using C's implicit conversion rules (i.e., the rules used when assigning to a variable without an explicit cast). - The `drgn.alignof()` function was added. It returns the alignment requirement of a type. - The `drgn.helpers.linux.module` module was added. It provides helpers for looking up and inspecting Linux kernel modules: `address_to_module()`, `find_module()`, `for_each_module()`, `module_address_regions()`, and `module_percpu_region()`. Contributed by Stephen Brennan. - The `drgn.helpers.linux.sched.task_thread_info()` helper was added. It returns the `struct thread_info *` for a given `struct task_struct *`. - The `drgn.helpers.linux.fs.d_path()` helper can now return an absolute path given only a dentry. Contributed by Stephen Brennan. - `drgn.Thread` now has a `name` attribute. Contributed by Ryan Wilson. - `tools/fsrefs.py` gained a new mode for finding what is using the filesystem on a given block device. - Linux 6.11 and 6.12 are now supported. - `tools/fsrefs.py` was updated to handle changes to uprobes in Linux 6.12. - Virtual address translation on AArch64 now supports Armv8.7 `FEAT_LPA2` (52-bit virtual addresses with 4k or 16k pages, added in Linux 6.9). - Absent objects with `void` type can now be printed instead of raising a `TypeError`. Bug fixes: - The `drgn.cast()` function was fixed to allow casting anything to a `void` type. - The `drgn.cast()` function's handling of casting to `bool` was fixed to convert to 0 or 1 instead of truncating to 8 bits. - The `bool()` operator was fixed to return `False` for array objects with address 0 (which is possible with weak symbols). - The `bool()` operator was fixed to allow passing a function object instead of raising a `TypeError`. - Functions that have both out-of-line and inline instances now have their address properly reported instead of being returned as absent objects. - Virtual address translation support on s390x was fixed to handle the virtual/physical address split in Linux 6.10. - Virtual address translation support on AArch64 was fixed to handle the fallback from 52- to 48- or 47-bit virtual addresses with 4k or 16k pages if the hardware doesn't support `FEAT_LPA2`. - The `drgn.helpers.common.memory.identify_address()` helper was fixed to not fail on kernels using the SLOB allocator. Contributed by Stephen Brennan. - The `drgn.helpers.common.memory.identify_address()` helper was fixed to properly identify vmap allocations on kernels not using vmap stacks. - The type annotation for `drgn.Object.from_bytes_()` was fixed to accept buffer types other than `bytes`. - A build script was fixed to work on POSIX (non-Bash) shells. Contributed by Sam James. API changes: - The `struct`, `union`, `class`, and `enum` keywords are now omitted when formatting a C++ type name. - The `bit_offset` and `bit_field_size` parameters of `drgn.Object.from_bytes_()` were fixed to be keyword-only as intended. They were previously annotated as keyword-only but were accepted positionally at runtime. Documentation: - Gentoo installation instructions were added. Contributed by Sam James. - Positional-only parameters are now documented (using the standard `/` syntax). - Helpers that depend on virtual address translation support now document that dependency, including the ways it can fail. - Stale documentation referring to complex types, which are not implemented, was removed. `contrib` directory: - `contrib/bpf_inspect.py` can now show maps and subprograms used by a BPF program. Contributed by Leon Hwang. - `contrib/bpf_inspect.py` was fixed to work on Python < 3.12. Contributed by Stephen Brennan. - `contrib/slabinfo.py` was added. It dumps slab allocator statistics similar to `/proc/slabinfo`. Contributed by Kuan-Ying Lee. - `contrib/vmallocinfo.py` was added. It dumps vmalloc information similar to `/proc/vmallocinfo`. Contributed by Kuan-Ying Lee. - `contrib/btrfs_print_fs_uuids_cache.py` was added. It prints Btrfs's internal list of filesystem UUIDs. Contributed by Srivathsa Dara. - `contrib/dm_crypt_key.py` was updated to handle Linux < 6.7. Internal: - Some code was moved to a new, top-level Python package, `_drgn_util`.

drgn 0.0.27v0.0.27
? · 2024-07-01

This release adds a few helpers, more pluggability for finding types, objects, and symbols, lots of new or improved scripts in `contrib`, and other improvements and bug fixes. New features: - The `print_annotated_memory()` helper was added to `drgn.helpers.common.memory`. It dumps a region of memory and annotates values that can be identified. - The `identify_address()` helper in `drgn.helpers.common.memory` can now identify Linux kernel vmap addresses and vmap kernel stacks. - The `member_at_offset()` helper was added to `drgn.helpers.common.type`. It returns the name of the member at an offset in a type. - The `bdev_partno()` helper was added to `drgn.helpers.linux.block`. It returns the partition number of a block device. - More flexible APIs for naming, reordering, and disabling type and object finders were added. - An API for registering custom symbol finders was added. Contributed by Stephen Brennan. - Support for Linux 6.9 and 6.10 was added. - The `drgn.helpers.linux.stackdepot.stack_depot_fetch()` helper was updated for Linux 6.9 (and 6.8.5). - The `drgn.helpers.linux.block.for_each_disk()` and `drgn.helpers.linux.mm.PageSlab()` helpers were updated for Linux 6.10. - The VMCOREINFO metadata for a kernel core dump can now be manually overridden through the Python API or the CLI. Contributed by Stephen Brennan. - x86-64 kernel core dumps without virtual memory information can now be read. Contributed by Stephen Brennan and Illia Ostapyshyn. - RISC-V kdump-compressed core dumps are now recognized as RISC-V when compiled with libkdumpfile 0.5.4 or newer. Contributed by Stephen Brennan. Bug fixes: - A case where drgn would fail to get the value of a local variable in an inlined function (usually when it had been spilled to the stack) was fixed. - Stack traces from kernel core dumps with missing (offline or unresponsive) CPUs were fixed. - Missing exception throws were added for some internal allocation failure checks in the drgn Python bindings. `contrib` directory: - `contrib/search_kernel_memory.py` was added. It searches all of kernel RAM for a given byte string. - `contrib/gcore.py` was added. It can extract a core dump of a running process without stopping it, or of a process from a kernel core dump. - `contrib/btrfs_tree.py` was substantially improved with new helpers and support for almost all Btrfs item types. - `contrib/negdentdelete.py` was added. It frees negative dentries. Contributed by Stephen Brennan. - `contrib/bpf_inspect.py` was updated to work on Linux 6.4 and later, gained a new command to list BPF links, gained an interactive mode, and added more detailed information. Contributed by Leon Hwang. - `contrib/irq.py` was updated to work on Linux 6.5 and later. Contributed by Imran Khan. - `contrib/lsmod.py` was updated to work on Linux 6.4 and later. Internal: - libdrgn's internal hash table implementation was optimized to use slightly less memory. - Unit tests were added for a lot of libdrgn internals. - Stephen Brennan fixed an issue with builds for free-threaded Python. - Michel Lind enabled Packit builds for CentOS Stream 9.

drgn 0.0.26v0.0.26
? · 2024-03-11

This release adds several helpers, support for DWARF package files, the `fsrefs.py` tool, and a few other improvements and bug fixes. New features: - The `print_dmesg()` helper was added to `drgn.helpers.linux.printk`. It is a shortcut for printing the contents of the kernel log buffer. - The `idr_for_each_entry()` helper was added to `drgn.helpers.linux.idr`. - Helpers for the Linux kernel's plist (priority-sorted list) data structure were added in `drgn.helpers.linux.plist`. Plists are used by futexes, real-time scheduling classes, and swap. - The `stack_depot_fetch()` helper was added in `drgn.helpers.linux.stackdepot`. It gets a stack trace from the stack depot, which is used by KASAN and other debugging tools in the kernel to store unique stack traces. Contributed by Peter Collingbourne. - `drgn.Program.stack_trace_from_pcs()` was added. It creates a `drgn.StackTrace` from a list of program counters. Contributed by Peter Collingbourne. - Support for Linux 6.8 was added. - The `for_each_mount()` and `path_lookup()` helpers from `drgn.helpers.linux.fs` were updated for Linux 6.8. The `for_each_mount()` update was contributed by Johannes Thumshirn. - DWARF package (.dwp) files are now supported when built with elfutils >= 0.191. - `drgn.reinterpret()` can now be used for primitive scalar values (but you usually want `drgn.cast()`). - drgn now transparently supports reading from pointers using AArch64's Top Byte Ignore (TBI) feature. Contributed by Peter Collingbourne. Bug fixes: - The `print_annotated_stack()` helper from `drgn.helpers.common.stack` was made more robust against corrupted stack traces. - A memory leak when handling types with C++ template parameters was fixed. - Types from type units from split DWARF files can now be searched by name. Other improvements: - `drgn.FaultError` is now imported in the CLI by default. - `drgn.FaultError`s caused by invalid physical addresses will now indicate that the address was physical. - Build errors when compiling against Python 3.13 alpha 4 were fixed. Tools: - `tools/fsrefs.py` was added. It searches for everything in the kernel referencing a file or filesystem. `contrib` directory: - `contrib/btrfs_orphan_subvolumes.py` was added. It looks for Btrfs subvolumes that have been deleted but not yet cleaned up. - `contrib/dm_crypt_key.py` was added. It reads the master key of a dm-crypt device from kernel memory (currently only if the encryption mode is `aes-xts-plain64`).