diff options
author | 2025-02-20 12:23:40 +0000 | |
---|---|---|
committer | 2025-03-16 23:24:15 -0700 | |
commit | 4022918876f9a28fe5379e2d7b7840e84f7b56ed (patch) | |
tree | fc26914114a7570a14d3469b82e670f553cf7761 /scripts/gdb/linux/utils.py | |
parent | MAINTAINERS: mailmap: update Hyeonggon's name and email address (diff) | |
download | wireguard-linux-4022918876f9a28fe5379e2d7b7840e84f7b56ed.tar.xz wireguard-linux-4022918876f9a28fe5379e2d7b7840e84f7b56ed.zip |
scripts/gdb: add $lx_per_cpu_ptr()
We currently have $lx_per_cpu() which works fine for stuff that kernel
code would access via per_cpu(). But this doesn't work for stuff that
kernel code accesses via per_cpu_ptr():
(gdb) p $lx_per_cpu(node_data[1].node_zones[2]->per_cpu_pageset)
Cannot access memory at address 0xffff11105fbd6c28
This is because we take the address of the pointer and use that as the
offset, instead of using the stored value.
Add a GDB version that mirrors the kernel API, which uses the pointer
value.
To be consistent with per_cpu_ptr(), we need to return the pointer value
instead of dereferencing it for the user. Therefore, move the existing
dereference out of the per_cpu() Python helper and do that only in the
$lx_per_cpu() implementation.
Link: https://lkml.kernel.org/r/20250220-lx-per-cpu-ptr-v2-1-945dee8d8d38@google.com
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Florian Rommel <mail@florommel.de>
Cc: Kieran Bingham <kbingham@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions