mbox series

[v2,0/8] Add GDB memory helper commands

Message ID 20230808083020.22254-1-Kuan-Ying.Lee@mediatek.com (mailing list archive)
Headers show
Series Add GDB memory helper commands | expand

Message

Kuan-Ying Lee (李冠穎) Aug. 8, 2023, 8:30 a.m. UTC
Hi all,

I've created some GDB commands I think useful when I debug
some memory issues and kernel module issue.

For memory issue, we would like to get slabinfo, slabtrace,
page_owner and vmallocinfo to debug the memory issues.

For module issue, we would like to query kernel module name
when we get a module text address and load module
symbol by specific path.

Patch 1-2:
 - Add kernel module related command.
Patch 3-5:
 - Prepares for the memory-related command.
Patch 6-8:
 - Add memory-related commands.

V1->V2:
 - Fix s390 build error with defconfig (Stephen)
 - Use freeptr_t structure for dereference freepointer
   in slab
 - Add CONFIG_STACKDEPOT statement to handle stackdepot
   is disable
 - Add CONFIG_PAGE_OWNER statement to handle page owner
   is disable
 - Rebase to linux-next/next-20230808

Kuan-Ying Lee (8):
  scripts/gdb/symbols: add specific ko module load command
  scripts/gdb/modules: add get module text support
  scripts/gdb/utils: add common type usage
  scripts/gdb/aarch64: add aarch64 page operation helper commands and
    configs
  scripts/gdb/stackdepot: Add stackdepot support
  scripts/gdb/page_owner: add page owner support
  scripts/gdb/slab: Add slab support
  scripts/gdb/vmalloc: add vmallocinfo support

 scripts/gdb/linux/constants.py.in |  52 +++
 scripts/gdb/linux/mm.py           | 582 +++++++++++++++++++-----------
 scripts/gdb/linux/modules.py      |  32 +-
 scripts/gdb/linux/page_owner.py   | 190 ++++++++++
 scripts/gdb/linux/pgtable.py      | 222 ++++++++++++
 scripts/gdb/linux/slab.py         | 326 +++++++++++++++++
 scripts/gdb/linux/stackdepot.py   |  55 +++
 scripts/gdb/linux/symbols.py      |  23 +-
 scripts/gdb/linux/utils.py        |  20 +
 scripts/gdb/linux/vmalloc.py      |  56 +++
 scripts/gdb/vmlinux-gdb.py        |   7 +-
 11 files changed, 1358 insertions(+), 207 deletions(-)
 create mode 100644 scripts/gdb/linux/page_owner.py
 create mode 100644 scripts/gdb/linux/pgtable.py
 create mode 100644 scripts/gdb/linux/slab.py
 create mode 100644 scripts/gdb/linux/stackdepot.py
 create mode 100644 scripts/gdb/linux/vmalloc.py