diff mbox series

[v2,2/3] scripts/gdb/stackdepot: Rename pool_index to pools_num

Message ID 20231129065142.13375-3-Kuan-Ying.Lee@mediatek.com (mailing list archive)
State New
Headers show
Series Fix GDB commands error | expand

Commit Message

Kuan-Ying Lee (李冠穎) Nov. 29, 2023, 6:51 a.m. UTC
After stackdepot evicting support patchset[1], we rename
pool_index to pools_num.

To avoid from the below issue, we rename consistently in
gdb scripts.

Python Exception <class 'gdb.error'>: No symbol "pool_index" in current
context.
Error occurred in Python: No symbol "pool_index" in current context.

[1] https://lore.kernel.org/linux-mm/cover.1700502145.git.andreyknvl@google.com/
Cc: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
---
 scripts/gdb/linux/stackdepot.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Florian Fainelli Nov. 29, 2023, 10:33 p.m. UTC | #1
On 11/28/23 22:51, Kuan-Ying Lee wrote:
> After stackdepot evicting support patchset[1], we rename
> pool_index to pools_num.
> 
> To avoid from the below issue, we rename consistently in
> gdb scripts.
> 
> Python Exception <class 'gdb.error'>: No symbol "pool_index" in current
> context.
> Error occurred in Python: No symbol "pool_index" in current context.
> 
> [1] https://lore.kernel.org/linux-mm/cover.1700502145.git.andreyknvl@google.com/
> Cc: Andrey Konovalov <andreyknvl@google.com>
> Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
diff mbox series

Patch

diff --git a/scripts/gdb/linux/stackdepot.py b/scripts/gdb/linux/stackdepot.py
index 047d329a6a12..0281d9de4b7c 100644
--- a/scripts/gdb/linux/stackdepot.py
+++ b/scripts/gdb/linux/stackdepot.py
@@ -25,10 +25,10 @@  def stack_depot_fetch(handle):
     handle_parts_t = gdb.lookup_type("union handle_parts")
     parts = handle.cast(handle_parts_t)
     offset = parts['offset'] << DEPOT_STACK_ALIGN
-    pool_index_cached = gdb.parse_and_eval('pool_index')
+    pools_num = gdb.parse_and_eval('pools_num')
 
-    if parts['pool_index'] > pool_index_cached:
-        gdb.write("pool index %d out of bounds (%d) for stack id 0x%08x\n" % (parts['pool_index'], pool_index_cached, handle))
+    if parts['pool_index'] > pools_num:
+        gdb.write("pool index %d out of bounds (%d) for stack id 0x%08x\n" % (parts['pool_index'], pools_num, handle))
         return gdb.Value(0), 0
 
     stack_pools = gdb.parse_and_eval('stack_pools')