mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00

- The 2 patch series "squashfs: Remove page->mapping references" from Matthew Wilcox gets us closer to being able to remove page->mapping. - The 5 patch series "relayfs: misc changes" from Jason Xing does some maintenance and minor feature addition work in relayfs. - The 5 patch series "kdump: crashkernel reservation from CMA" from Jiri Bohac switches us from static preallocation of the kdump crashkernel's working memory over to dynamic allocation. So the difficulty of a-priori estimation of the second kernel's needs is removed and the first kernel obtains extra memory. - The 5 patch series "generalize panic_print's dump function to be used by other kernel parts" from Feng Tang implements some consolidation and rationalizatio of the various ways in which a faiing kernel splats information at the operator. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCaI+82gAKCRDdBJ7gKXxA jj4JAP9xb+w9DrBY6sa+7KTPIb+aTqQ7Zw3o9O2m+riKQJv6jAEA6aEwRnDA0451 fDT5IqVlCWGvnVikdZHSnvhdD7TGsQ0= =rT71 -----END PGP SIGNATURE----- Merge tag 'mm-nonmm-stable-2025-08-03-12-47' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull non-MM updates from Andrew Morton: "Significant patch series in this pull request: - "squashfs: Remove page->mapping references" (Matthew Wilcox) gets us closer to being able to remove page->mapping - "relayfs: misc changes" (Jason Xing) does some maintenance and minor feature addition work in relayfs - "kdump: crashkernel reservation from CMA" (Jiri Bohac) switches us from static preallocation of the kdump crashkernel's working memory over to dynamic allocation. So the difficulty of a-priori estimation of the second kernel's needs is removed and the first kernel obtains extra memory - "generalize panic_print's dump function to be used by other kernel parts" (Feng Tang) implements some consolidation and rationalization of the various ways in which a failing kernel splats information at the operator * tag 'mm-nonmm-stable-2025-08-03-12-47' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (80 commits) tools/getdelays: add backward compatibility for taskstats version kho: add test for kexec handover delaytop: enhance error logging and add PSI feature description samples: Kconfig: fix spelling mistake "instancess" -> "instances" fat: fix too many log in fat_chain_add() scripts/spelling.txt: add notifer||notifier to spelling.txt xen/xenbus: fix typo "notifer" net: mvneta: fix typo "notifer" drm/xe: fix typo "notifer" cxl: mce: fix typo "notifer" KVM: x86: fix typo "notifer" MAINTAINERS: add maintainers for delaytop ucount: use atomic_long_try_cmpxchg() in atomic_long_inc_below() ucount: fix atomic_long_inc_below() argument type kexec: enable CMA based contiguous allocation stackdepot: make max number of pools boot-time configurable lib/xxhash: remove unused functions init/Kconfig: restore CONFIG_BROKEN help text lib/raid6: update recov_rvv.c zero page usage docs: update docs after introducing delaytop ...
173 lines
4.4 KiB
Python
173 lines
4.4 KiB
Python
/*
|
|
* gdb helper commands and functions for Linux kernel debugging
|
|
*
|
|
* Kernel constants derived from include files.
|
|
*
|
|
* Copyright (c) 2016 Linaro Ltd
|
|
*
|
|
* Authors:
|
|
* Kieran Bingham <kieran.bingham@linaro.org>
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL version 2.
|
|
*
|
|
*/
|
|
|
|
#include <linux/clk-provider.h>
|
|
#include <linux/fs.h>
|
|
#include <linux/hrtimer.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/mount.h>
|
|
#include <linux/of_fdt.h>
|
|
#include <linux/page_ext.h>
|
|
#include <linux/radix-tree.h>
|
|
#include <linux/maple_tree.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/threads.h>
|
|
#include <linux/vmalloc.h>
|
|
|
|
/* We need to stringify expanded macros so that they can be parsed */
|
|
|
|
#define STRING(x) #x
|
|
#define XSTRING(x) STRING(x)
|
|
|
|
#define LX_VALUE(x) LX_##x = x
|
|
#define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x))
|
|
|
|
/*
|
|
* IS_ENABLED generates (a || b) which is not compatible with python
|
|
* We can only switch on configuration items we know are available
|
|
* Therefore - IS_BUILTIN() is more appropriate
|
|
*/
|
|
#define LX_CONFIG(x) LX_##x = IS_BUILTIN(x)
|
|
|
|
/* The build system will take care of deleting everything above this marker */
|
|
<!-- end-c-headers -->
|
|
|
|
import gdb
|
|
|
|
LX_CONFIG(CONFIG_DEBUG_INFO_REDUCED)
|
|
|
|
/* linux/clk-provider.h */
|
|
if IS_BUILTIN(CONFIG_COMMON_CLK):
|
|
LX_GDBPARSED(CLK_GET_RATE_NOCACHE)
|
|
|
|
/* linux/fs.h */
|
|
LX_GDBPARSED(SB_RDONLY)
|
|
LX_GDBPARSED(SB_SYNCHRONOUS)
|
|
LX_GDBPARSED(SB_MANDLOCK)
|
|
LX_GDBPARSED(SB_DIRSYNC)
|
|
LX_GDBPARSED(SB_NOATIME)
|
|
LX_GDBPARSED(SB_NODIRATIME)
|
|
|
|
/* linux/htimer.h */
|
|
LX_GDBPARSED(hrtimer_resolution)
|
|
|
|
/* linux/irq.h */
|
|
LX_GDBPARSED(IRQD_LEVEL)
|
|
LX_GDBPARSED(IRQ_HIDDEN)
|
|
|
|
/* linux/module.h */
|
|
if IS_BUILTIN(CONFIG_MODULES):
|
|
LX_GDBPARSED(MOD_TEXT)
|
|
LX_GDBPARSED(MOD_DATA)
|
|
LX_GDBPARSED(MOD_RODATA)
|
|
LX_GDBPARSED(MOD_RO_AFTER_INIT)
|
|
|
|
/* linux/mount.h */
|
|
LX_GDBPARSED(MNT_NOSUID)
|
|
LX_GDBPARSED(MNT_NODEV)
|
|
LX_GDBPARSED(MNT_NOEXEC)
|
|
LX_GDBPARSED(MNT_NOATIME)
|
|
LX_GDBPARSED(MNT_NODIRATIME)
|
|
LX_GDBPARSED(MNT_RELATIME)
|
|
|
|
/* linux/threads.h */
|
|
LX_VALUE(NR_CPUS)
|
|
|
|
/* linux/of_fdt.h> */
|
|
LX_VALUE(OF_DT_HEADER)
|
|
|
|
/* linux/radix-tree.h */
|
|
LX_GDBPARSED(RADIX_TREE_ENTRY_MASK)
|
|
LX_GDBPARSED(RADIX_TREE_INTERNAL_NODE)
|
|
LX_GDBPARSED(RADIX_TREE_MAP_SIZE)
|
|
LX_GDBPARSED(RADIX_TREE_MAP_SHIFT)
|
|
LX_GDBPARSED(RADIX_TREE_MAP_MASK)
|
|
|
|
/* linux/maple_tree.h */
|
|
LX_VALUE(MAPLE_NODE_SLOTS)
|
|
LX_VALUE(MAPLE_RANGE64_SLOTS)
|
|
LX_VALUE(MAPLE_ARANGE64_SLOTS)
|
|
LX_GDBPARSED(MAPLE_NODE_MASK)
|
|
|
|
/* linux/vmalloc.h */
|
|
LX_VALUE(VM_IOREMAP)
|
|
LX_VALUE(VM_ALLOC)
|
|
LX_VALUE(VM_MAP)
|
|
LX_VALUE(VM_USERMAP)
|
|
LX_VALUE(VM_DMA_COHERENT)
|
|
|
|
/* linux/page_ext.h */
|
|
if IS_BUILTIN(CONFIG_PAGE_OWNER):
|
|
LX_GDBPARSED(PAGE_EXT_OWNER)
|
|
LX_GDBPARSED(PAGE_EXT_OWNER_ALLOCATED)
|
|
|
|
/* linux/slab.h */
|
|
LX_GDBPARSED(SLAB_RED_ZONE)
|
|
LX_GDBPARSED(SLAB_POISON)
|
|
LX_GDBPARSED(SLAB_KMALLOC)
|
|
LX_GDBPARSED(SLAB_HWCACHE_ALIGN)
|
|
LX_GDBPARSED(SLAB_CACHE_DMA)
|
|
LX_GDBPARSED(SLAB_CACHE_DMA32)
|
|
LX_GDBPARSED(SLAB_STORE_USER)
|
|
LX_GDBPARSED(SLAB_PANIC)
|
|
|
|
/* Kernel Configs */
|
|
LX_CONFIG(CONFIG_GENERIC_CLOCKEVENTS)
|
|
LX_CONFIG(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
|
|
LX_CONFIG(CONFIG_HIGH_RES_TIMERS)
|
|
LX_CONFIG(CONFIG_NR_CPUS)
|
|
LX_CONFIG(CONFIG_OF)
|
|
LX_CONFIG(CONFIG_TICK_ONESHOT)
|
|
LX_CONFIG(CONFIG_GENERIC_IRQ_SHOW_LEVEL)
|
|
LX_CONFIG(CONFIG_X86_LOCAL_APIC)
|
|
LX_CONFIG(CONFIG_SMP)
|
|
LX_CONFIG(CONFIG_X86_THERMAL_VECTOR)
|
|
LX_CONFIG(CONFIG_X86_MCE_THRESHOLD)
|
|
LX_CONFIG(CONFIG_X86_MCE_AMD)
|
|
LX_CONFIG(CONFIG_X86_MCE)
|
|
LX_CONFIG(CONFIG_X86_IO_APIC)
|
|
/*
|
|
* CONFIG_KVM can be "m" but it affects common code too. Use CONFIG_KVM_COMMON
|
|
* as a proxy for IS_ENABLED(CONFIG_KVM).
|
|
*/
|
|
LX_CONFIG_KVM = IS_BUILTIN(CONFIG_KVM_COMMON)
|
|
LX_CONFIG(CONFIG_NUMA)
|
|
LX_CONFIG(CONFIG_ARM64)
|
|
LX_CONFIG(CONFIG_ARM64_4K_PAGES)
|
|
LX_CONFIG(CONFIG_ARM64_16K_PAGES)
|
|
LX_CONFIG(CONFIG_ARM64_64K_PAGES)
|
|
if IS_BUILTIN(CONFIG_ARM64):
|
|
LX_VALUE(CONFIG_ARM64_PA_BITS)
|
|
LX_VALUE(CONFIG_ARM64_VA_BITS)
|
|
LX_VALUE(CONFIG_PAGE_SHIFT)
|
|
LX_VALUE(CONFIG_ARCH_FORCE_MAX_ORDER)
|
|
LX_CONFIG(CONFIG_SPARSEMEM)
|
|
LX_CONFIG(CONFIG_SPARSEMEM_EXTREME)
|
|
LX_CONFIG(CONFIG_SPARSEMEM_VMEMMAP)
|
|
LX_CONFIG(CONFIG_KASAN)
|
|
LX_CONFIG(CONFIG_KASAN_GENERIC)
|
|
LX_CONFIG(CONFIG_KASAN_SW_TAGS)
|
|
LX_CONFIG(CONFIG_KASAN_HW_TAGS)
|
|
if IS_BUILTIN(CONFIG_KASAN_GENERIC) or IS_BUILTIN(CONFIG_KASAN_SW_TAGS):
|
|
LX_VALUE(CONFIG_KASAN_SHADOW_OFFSET)
|
|
LX_CONFIG(CONFIG_VMAP_STACK)
|
|
if IS_BUILTIN(CONFIG_NUMA):
|
|
LX_VALUE(CONFIG_NODES_SHIFT)
|
|
LX_CONFIG(CONFIG_DEBUG_VIRTUAL)
|
|
LX_CONFIG(CONFIG_STACKDEPOT)
|
|
LX_CONFIG(CONFIG_PAGE_OWNER)
|
|
LX_CONFIG(CONFIG_SLUB_DEBUG)
|
|
LX_CONFIG(CONFIG_SLAB_FREELIST_HARDENED)
|
|
LX_CONFIG(CONFIG_MMU)
|