[merged] scripts-gdb-add-hlist-utilities.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: scripts/gdb: add hlist utilities
has been removed from the -mm tree.  Its filename was
     scripts-gdb-add-hlist-utilities.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Leonard Crestez <leonard.crestez@xxxxxxx>
Subject: scripts/gdb: add hlist utilities

This allows easily examining kernel hlists in python.

Link: http://lkml.kernel.org/r/Message-ID:
Signed-off-by: Leonard Crestez <leonard.crestez@xxxxxxx>
Reviewed-by: Stephen Boyd <sboyd@xxxxxxxxxx>
Cc: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
Cc: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
Cc: Kieran Bingham <kbingham@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/gdb/linux/lists.py |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

--- a/scripts/gdb/linux/lists.py~scripts-gdb-add-hlist-utilities
+++ a/scripts/gdb/linux/lists.py
@@ -16,6 +16,8 @@ import gdb
 from linux import utils
 
 list_head = utils.CachedType("struct list_head")
+hlist_head = utils.CachedType("struct hlist_head")
+hlist_node = utils.CachedType("struct hlist_node")
 
 
 def list_for_each(head):
@@ -38,6 +40,27 @@ def list_for_each_entry(head, gdbtype, m
                             .format(node.type))
         yield utils.container_of(node, gdbtype, member)
 
+
+def hlist_for_each(head):
+    if head.type == hlist_head.get_type().pointer():
+        head = head.dereference()
+    elif head.type != hlist_head.get_type():
+        raise gdb.GdbError("Must be struct hlist_head not {}"
+                           .format(head.type))
+
+    node = head['first'].dereference()
+    while node.address:
+        yield node.address
+        node = node['next'].dereference()
+
+
+def hlist_for_each_entry(head, gdbtype, member):
+    for node in hlist_for_each(head):
+        if node.type != hlist_node.get_type().pointer():
+            raise TypeError("Type {} found. Expected struct hlist_head *."
+                            .format(node.type))
+        yield utils.container_of(node, gdbtype, member)
+
 
 def list_check(head):
     nb = 0
_

Patches currently in -mm which might be from leonard.crestez@xxxxxxx are





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux