The patch titled Subject: lib/hexdump: add a raw pointer printing format for slub debugging has been added to the -mm tree. Its filename is lib-hexdump-add-a-raw-pointer-printing-format-for-slub-debugging.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/lib-hexdump-add-a-raw-pointer-printing-format-for-slub-debugging.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/lib-hexdump-add-a-raw-pointer-printing-format-for-slub-debugging.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Stephen Boyd <swboyd@xxxxxxxxxxxx> Subject: lib/hexdump: add a raw pointer printing format for slub debugging Patch series "slub: Print non-hashed pointers in slub debugging". I was doing some debugging recently and noticed that my pointers were being hashed while slub_debug was on the kernel commandline. Let's make the prints in here meaningful in that case by pushing %px throughout. Alternatively, we could force on no_hash_pointers if slub_debug is on the commandline. Maybe that would be better? The final patch is just something else I noticed while looking at the code. The message argument is never used so the debugging messages are not as clear as they could be. This patch (of 3): We want to get actual pointer addresses when we're looking at slub debugging reports. Add another prefix format specifier that says we want raw pointer addresses, i.e. %px, in the printk format. Link: https://lkml.kernel.org/r/20210520013539.3733631-1-swboyd@xxxxxxxxxxxx Link: https://lkml.kernel.org/r/20210520013539.3733631-2-swboyd@xxxxxxxxxxxx Signed-off-by: Stephen Boyd <swboyd@xxxxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/printk.h | 1 + lib/hexdump.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) --- a/include/linux/printk.h~lib-hexdump-add-a-raw-pointer-printing-format-for-slub-debugging +++ a/include/linux/printk.h @@ -567,6 +567,7 @@ extern const struct file_operations kmsg enum { DUMP_PREFIX_NONE, DUMP_PREFIX_ADDRESS, + DUMP_PREFIX_RAW_ADDRESS, DUMP_PREFIX_OFFSET }; extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, --- a/lib/hexdump.c~lib-hexdump-add-a-raw-pointer-printing-format-for-slub-debugging +++ a/lib/hexdump.c @@ -211,8 +211,12 @@ EXPORT_SYMBOL(hex_dump_to_buffer); * @level: kernel log level (e.g. KERN_DEBUG) * @prefix_str: string to prefix each line with; * caller supplies trailing spaces for alignment if desired - * @prefix_type: controls whether prefix of an offset, address, or none - * is printed (%DUMP_PREFIX_OFFSET, %DUMP_PREFIX_ADDRESS, %DUMP_PREFIX_NONE) + * @prefix_type: controls how prefix is printed + * %DUMP_PREFIX_OFFSET - offset prefix + * %DUMP_PREFIX_ADDRESS - hashed address prefix + * %DUMP_PREFIX_RAW_ADDRESS - non-hashed address prefix + * %DUMP_PREFIX_NONE - no prefix + * * @rowsize: number of bytes to print per line; must be 16 or 32 * @groupsize: number of bytes to print at a time (1, 2, 4, 8; default = 1) * @buf: data blob to dump @@ -260,6 +264,10 @@ void print_hex_dump(const char *level, c printk("%s%s%p: %s\n", level, prefix_str, ptr + i, linebuf); break; + case DUMP_PREFIX_RAW_ADDRESS: + printk("%s%s%px: %s\n", + level, prefix_str, ptr + i, linebuf); + break; case DUMP_PREFIX_OFFSET: printk("%s%s%.8x: %s\n", level, prefix_str, i, linebuf); break; _ Patches currently in -mm which might be from swboyd@xxxxxxxxxxxx are lib-hexdump-add-a-raw-pointer-printing-format-for-slub-debugging.patch slub-print-raw-pointer-addresses-when-debugging.patch slub-actually-use-message-in-restore_bytes.patch buildid-only-consider-gnu-notes-for-build-id-parsing.patch buildid-add-api-to-parse-build-id-out-of-buffer.patch buildid-stash-away-kernels-build-id-on-init.patch buildid-stash-away-kernels-build-id-on-init-fix.patch dump_stack-add-vmlinux-build-id-to-stack-traces.patch module-add-printk-formats-to-add-module-build-id-to-stacktraces.patch arm64-stacktrace-use-%psb-for-backtrace-printing.patch x86-dumpstack-use-%psb-%pbb-for-backtrace-printing.patch scripts-decode_stacktracesh-support-debuginfod.patch scripts-decode_stacktracesh-silence-stderr-messages-from-addr2line-nm.patch scripts-decode_stacktracesh-indicate-auto-can-be-used-for-base-path.patch buildid-mark-some-arguments-const.patch buildid-fix-kernel-doc-notation.patch kdump-use-vmlinux_build_id-to-simplify.patch