[PATCH RESEND 2/3] scripts/gdb: timerlist: fix rb_node access

Florian Fainelli posted 3 patches 2 years, 10 months ago
[PATCH RESEND 2/3] scripts/gdb: timerlist: fix rb_node access
Posted by Florian Fainelli 2 years, 10 months ago
From: Amjad Ouled-Ameur <aouledameur@baylibre.com>

"struct timerqueue_head" no longer has "next" member since v5.4-rc1:
commit 511885d7061e ("lib/timerqueue: Rely on rbtree semantics for next
timer")

Therefore, access "rb_node" through active->rb_root->rb_root->rb_node.

Moreoever, remove  curr.address.cast() on rb_node as this breaks the code
and is not necessary.

Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
---
 scripts/gdb/linux/timerlist.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/gdb/linux/timerlist.py b/scripts/gdb/linux/timerlist.py
index fac951236dc4..d16909f8df35 100644
--- a/scripts/gdb/linux/timerlist.py
+++ b/scripts/gdb/linux/timerlist.py
@@ -43,8 +43,7 @@ def print_timer(rb_node, idx):
 
 
 def print_active_timers(base):
-    curr = base['active']['next']['node']
-    curr = curr.address.cast(rbtree.rb_node_type.get_type().pointer())
+    curr = base['active']['rb_root']['rb_root']['rb_node']
     idx = 0
     while curr:
         yield print_timer(curr, idx)
-- 
2.34.1