scripts/gdb: add a Radix Tree Parser
authorKieran Bingham <kieran.bingham@linaro.org>
Mon, 23 May 2016 23:25:07 +0000 (16:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 May 2016 00:04:14 +0000 (17:04 -0700)
commite127a73d41ac471d7e3ba950cf128f42d6ee3448
tree2924b84523d67d46d9d533ac88e011a82054b5e3
parent4bc393dbcf1915224e8947211a0ca906f9de7c56
scripts/gdb: add a Radix Tree Parser

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)

Link: http://lkml.kernel.org/r/d2028c55e50cf95a9b7f8ca0d11885174b0cc709.1462865983.git.jan.kiszka@siemens.com
Signed-off-by: Kieran Bingham <kieran.bingham@linaro.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/gdb/linux/constants.py.in
scripts/gdb/linux/radixtree.py [new file with mode: 0644]
scripts/gdb/vmlinux-gdb.py