Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ref_tracker: don't use %pK in pr_ostream() output

As Thomas Weißschuh points out [1], it is now preferable to use %p
instead of hashed pointers with printk(), since raw pointers should no
longer be leaked into the kernel log. Change the ref_tracker
infrastructure to use %p instead of %pK in its formats.

[1]: https://lore.kernel.org/netdev/20250414-restricted-pointers-net-v1-0-12af0ce46cdd@linutronix.de/

Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20250618-reftrack-dbgfs-v15-1-24fc37ead144@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jeff Layton and committed by
Jakub Kicinski
7d02ba96 e04c78d8

+3 -3
+3 -3
lib/ref_tracker.c
··· 96 96 97 97 stats = ref_tracker_get_stats(dir, display_limit); 98 98 if (IS_ERR(stats)) { 99 - pr_ostream(s, "%s@%pK: couldn't get stats, error %pe\n", 99 + pr_ostream(s, "%s@%p: couldn't get stats, error %pe\n", 100 100 dir->name, dir, stats); 101 101 return; 102 102 } ··· 107 107 stack = stats->stacks[i].stack_handle; 108 108 if (sbuf && !stack_depot_snprint(stack, sbuf, STACK_BUF_SIZE, 4)) 109 109 sbuf[0] = 0; 110 - pr_ostream(s, "%s@%pK has %d/%d users at\n%s\n", dir->name, dir, 110 + pr_ostream(s, "%s@%p has %d/%d users at\n%s\n", dir->name, dir, 111 111 stats->stacks[i].count, stats->total, sbuf); 112 112 skipped -= stats->stacks[i].count; 113 113 } 114 114 115 115 if (skipped) 116 - pr_ostream(s, "%s@%pK skipped reports about %d/%d users.\n", 116 + pr_ostream(s, "%s@%p skipped reports about %d/%d users.\n", 117 117 dir->name, dir, skipped, stats->total); 118 118 119 119 kfree(sbuf);