On 2023/12/07 10:07, Lianbo Jiang wrote: > On 12/6/23 11:45, 薛国伦 wrote: > >> Hi Lianbo: >> >> >> the vmlinux i download from links: >> https://ci.android.com/builds/submitted/11087000/kernel_aarch64/latest?hl=zh-cn <https://ci.android.com/builds/submitted/11087000/kernel_aarch64/latest?hl=zh-cn> >> >> >> md5sum ~/Downloads/vmlinux >> >> 5927b52ad342e6e34136b04b9d16ab46 vmlinux >> > > It's true, it looks like the variable nr_swapper_spaces is optimized away. > > > (gdb) p linux_banner > $3 = "Linux version 6.1.43-android14-11-gebd072ea164a-ab11087000 > (build-user@build-host) (Android (10087095, +pgo, +bolt, +lto, -mlgo, > based on r487747c) clang version 17.0.2 (https://android.googlesource.c"... > > > (gdb) p nr_swapper_spaces > $4 = <optimized out> Thank you folks, for the various information. Apparently the data of nr_swapper_spaces exists in the kernel, but its symbol does not exist. I think this means that we cannot calculate the number of pages from swapper_spaces[] with such a debuginfo, because we cannot get the array size of a swapper_spaces entry. So I'd like to go with Johan's patch. cc -c -g -DX86_64 -DLZO -DSNAPPY -DGDB_10_2 memory.c -Wall -O2 -Wstrict-prototypes -Wmissing-prototypes -fstack-protector -Wformat-security memory.c: In function dump_kmeminfo: memory.c:8612:50: warning: pointer targets in passing argument 2 of dump_vm_stat differ in signedness [-Wpointer-sign] 8612 | if (dump_vm_stat("NR_SWAPCACHE", &swapper_space_nrpages, 0)) { | ^~~~~~~~~~~~~~~~~~~~~~ | | | ulong * {aka long unsigned int *} memory.c:298:33: note: expected long int * but argument is of type ulong * {aka long unsigned int *} 298 | static int dump_vm_stat(char *, long *, ulong); | ^~~~~~ So with the following, - ulong swapper_space_nrpages; + long swapper_space_nrpages; Acked-by: Kazuhito Hagio <k-hagio-ab@xxxxxxx> Thanks, Kazu -- Crash-utility mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxxxxxx https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/ Contribution Guidelines: https://github.com/crash-utility/crash/wiki