Skip to content

Commit 9d938f4

Browse files
kylee0215akpm00
authored andcommitted
scripts/gdb: rename pool_index to pool_index_plus_1
We encounter the following issue after commit a6c1d9c ("stackdepot: rename pool_index to pool_index_plus_1"). (gdb) lx-dump-page-owner --pfn 262144 ... Python Exception <class 'gdb.error'>: There is no member named pool_index. Error occurred in Python: There is no member named pool_index. We rename pool_index to pool_index_plus_1 to fix this issue. Link: https://lkml.kernel.org/r/[email protected] Fixes: a6c1d9c ("stackdepot: rename pool_index to pool_index_plus_1") Signed-off-by: Kuan-Ying Lee <[email protected]> Cc: Jan Kiszka <[email protected]> Cc: Kieran Bingham <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Michael Ellerman <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7d8742b commit 9d938f4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/gdb/linux/stackdepot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@ def stack_depot_fetch(handle):
2727
offset = parts['offset'] << DEPOT_STACK_ALIGN
2828
pools_num = gdb.parse_and_eval('pools_num')
2929

30-
if parts['pool_index'] > pools_num:
30+
if handle == 0:
31+
raise gdb.GdbError("handle is 0\n")
32+
33+
pool_index = parts['pool_index_plus_1'] - 1
34+
if pool_index >= pools_num:
3135
gdb.write("pool index %d out of bounds (%d) for stack id 0x%08x\n" % (parts['pool_index'], pools_num, handle))
3236
return gdb.Value(0), 0
3337

3438
stack_pools = gdb.parse_and_eval('stack_pools')
3539

3640
try:
37-
pool = stack_pools[parts['pool_index']]
41+
pool = stack_pools[pool_index]
3842
stack = (pool + gdb.Value(offset).cast(utils.get_size_t_type())).cast(stack_record_type.get_type().pointer())
3943
size = int(stack['size'].cast(utils.get_ulong_type()))
4044
return stack['entries'], size

0 commit comments

Comments
 (0)