mirror of https://github.com/torvalds/linux.git
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>
This commit is contained in:
parent
e04c78d86a
commit
7d02ba9663
|
|
@ -96,7 +96,7 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
|
||||||
|
|
||||||
stats = ref_tracker_get_stats(dir, display_limit);
|
stats = ref_tracker_get_stats(dir, display_limit);
|
||||||
if (IS_ERR(stats)) {
|
if (IS_ERR(stats)) {
|
||||||
pr_ostream(s, "%s@%pK: couldn't get stats, error %pe\n",
|
pr_ostream(s, "%s@%p: couldn't get stats, error %pe\n",
|
||||||
dir->name, dir, stats);
|
dir->name, dir, stats);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -107,13 +107,13 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir,
|
||||||
stack = stats->stacks[i].stack_handle;
|
stack = stats->stacks[i].stack_handle;
|
||||||
if (sbuf && !stack_depot_snprint(stack, sbuf, STACK_BUF_SIZE, 4))
|
if (sbuf && !stack_depot_snprint(stack, sbuf, STACK_BUF_SIZE, 4))
|
||||||
sbuf[0] = 0;
|
sbuf[0] = 0;
|
||||||
pr_ostream(s, "%s@%pK has %d/%d users at\n%s\n", dir->name, dir,
|
pr_ostream(s, "%s@%p has %d/%d users at\n%s\n", dir->name, dir,
|
||||||
stats->stacks[i].count, stats->total, sbuf);
|
stats->stacks[i].count, stats->total, sbuf);
|
||||||
skipped -= stats->stacks[i].count;
|
skipped -= stats->stacks[i].count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skipped)
|
if (skipped)
|
||||||
pr_ostream(s, "%s@%pK skipped reports about %d/%d users.\n",
|
pr_ostream(s, "%s@%p skipped reports about %d/%d users.\n",
|
||||||
dir->name, dir, skipped, stats->total);
|
dir->name, dir, skipped, stats->total);
|
||||||
|
|
||||||
kfree(sbuf);
|
kfree(sbuf);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue