Skip to contentSkip to conversation

scripts-gdb-add-a-radix-tree-parser.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Apr 18, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: scripts/gdb: add a Radix Tree Parser
has been removed from the -mm tree. Its filename was
scripts-gdb-add-a-radix-tree-parser.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kieran Bingham <[email protected]>
Subject: scripts/gdb: add a Radix Tree Parser
Date: Tue, 4 Apr 2023 14:40:49 -0700

Linux makes use of the Radix Tree data structure to store pointers indexed by integer values. This structure is utilised across many structures in the kernel including the IRQ descriptor tables, and several filesystems.

This module provides a method to lookup values from a structure given its head node.

Usage:

The function lx_radix_tree_lookup, must be given a symbol of type struct radix_tree_root, and an index into that tree.

The object returned is a generic integer value, and must be cast correctly to the type based on the storage in the data structure.

For example, to print the irq descriptor in the sparse irq_desc_tree at index 18, try the following:

(gdb) print (struct irq_desc)$lx_radix_tree_lookup(irq_desc_tree, 18)

This script previously existed under commit e127a73d41ac471d7e3ba950cf128f42d6ee3448 ("scripts/gdb: add a Radix Tree Parser") and was later reverted with b447e02548a3304c47b78b5e2d75a4312a8f17e1i (Revert "scripts/gdb: add a Radix Tree Parser").

This version expects the XArray based radix tree implementation and has been verified using QEMU/x86 on Linux 6.3-rc5.

---

 scripts/gdb/linux/constants.py.in |    8 ++
 scripts/gdb/linux/radixtree.py    |   90 ++++++++++++++++++++++++++++
 scripts/gdb/vmlinux-gdb.py        |    1 
 3 files changed, 99 insertions(+)
scripts/gdb/linux/constants.py.in renamed from scripts/gdb/linux/constants.py.in~scripts-gdb-add-a-radix-tree-parser +8 -0
@@ -17,6 +17,7 @@
 #include <linux/hrtimer.h>
 #include <linux/mount.h>
 #include <linux/of_fdt.h>
+#include <linux/radix-tree.h>
 #include <linux/threads.h>
 
 /* We need to stringify expanded macros so that they can be parsed */
@@ -68,6 +69,13 @@ LX_VALUE(NR_CPUS)
 /* linux/of_fdt.h> */
 LX_VALUE(OF_DT_HEADER)
 
+/* linux/radix-tree.h */
+LX_GDBPARSED(RADIX_TREE_ENTRY_MASK)
+LX_GDBPARSED(RADIX_TREE_INTERNAL_NODE)
+LX_GDBPARSED(RADIX_TREE_MAP_SIZE)
+LX_GDBPARSED(RADIX_TREE_MAP_SHIFT)
+LX_GDBPARSED(RADIX_TREE_MAP_MASK)
+
 /* Kernel Configs */
 LX_CONFIG(CONFIG_GENERIC_CLOCKEVENTS)
 LX_CONFIG(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
scripts/gdb/linux/radixtree.py new file +90 -0

90 lines not on this page · raw message

scripts/gdb/vmlinux-gdb.py renamed from scripts/gdb/vmlinux-gdb.py~scripts-gdb-add-a-radix-tree-parser +1 -0
@@ -38,3 +38,4 @@ else:
     import linux.genpd
     import linux.device
     import linux.mm
+    import linux.radixtree

_

Patches currently in -mm which might be from [email protected] are