aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/gdb/linux/rbtree.py
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.com>2024-11-18 21:29:33 +0100
committerJiri Kosina <jkosina@suse.com>2024-11-18 21:29:33 +0100
commitf33e46a0c6bddd341d0989484a2546bba7ac4a3c (patch)
tree4918985ab00890205c8d77d0553472e12e01cd55 /scripts/gdb/linux/rbtree.py
parentHID: hyperv: streamline driver probe to avoid devres issues (diff)
parentHID: wacom: Set eraser status when either 'Eraser' or 'Invert' usage is set (diff)
downloadwireguard-linux-f33e46a0c6bddd341d0989484a2546bba7ac4a3c.tar.xz
wireguard-linux-f33e46a0c6bddd341d0989484a2546bba7ac4a3c.zip
Merge branch 'for-6.13/wacom' into for-linus
- Sanitization of BTN_TOOL_RUBBER handling (Jason Gerecke)
Diffstat (limited to '')
-rw-r--r--scripts/gdb/linux/rbtree.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/gdb/linux/rbtree.py b/scripts/gdb/linux/rbtree.py
index fe462855eefd..fcbcc5f4153c 100644
--- a/scripts/gdb/linux/rbtree.py
+++ b/scripts/gdb/linux/rbtree.py
@@ -9,6 +9,18 @@ from linux import utils
rb_root_type = utils.CachedType("struct rb_root")
rb_node_type = utils.CachedType("struct rb_node")
+def rb_inorder_for_each(root):
+ def inorder(node):
+ if node:
+ yield from inorder(node['rb_left'])
+ yield node
+ yield from inorder(node['rb_right'])
+
+ yield from inorder(root['rb_node'])
+
+def rb_inorder_for_each_entry(root, gdbtype, member):
+ for node in rb_inorder_for_each(root):
+ yield utils.container_of(node, gdbtype, member)
def rb_first(root):
if root.type == rb_root_type.get_type():