summaryrefslogtreecommitdiff
path: root/lib/test_printf.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-02-22 11:04:36 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2021-02-22 11:04:36 -0800
commitb2bec7d8a42a3885d525e821d9354b6b08fd6adf (patch)
tree8198d77e5b2fb8fc645ae42662b93a575910a032 /lib/test_printf.c
parent783955f03de770e94a1200b8f719975f8768e76c (diff)
parent16182ac1f02c8a5fc9753f9b8b5f3ef8c01707d8 (diff)
Merge tag 'printk-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux
Pull printk updates from Petr Mladek: - New "no_hash_pointers" kernel parameter causes that %p shows raw pointer values instead of hashed ones. It is intended only for debugging purposes. Misuse is prevented by a fat warning message that is inspired by trace_printk(). - Prevent a possible deadlock when flushing printk_safe buffers during panic(). - Fix performance regression caused by the lockless printk ringbuffer. It was visible with huge log buffer and long messages. - Documentation fix-up. * tag 'printk-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: lib/vsprintf: no_hash_pointers prints all addresses as unhashed kselftest: add support for skipped tests lib: use KSTM_MODULE_GLOBALS macro in kselftest drivers printk: avoid prb_first_valid_seq() where possible printk: fix deadlock when kernel panic printk: rectify kernel-doc for prb_rec_init_wr()
Diffstat (limited to 'lib/test_printf.c')
-rw-r--r--lib/test_printf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/test_printf.c b/lib/test_printf.c
index 7d60f24240a4..95a2f82427c7 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -30,11 +30,13 @@
#define PAD_SIZE 16
#define FILL_CHAR '$'
-static unsigned total_tests __initdata;
-static unsigned failed_tests __initdata;
+KSTM_MODULE_GLOBALS();
+
static char *test_buffer __initdata;
static char *alloced_buffer __initdata;
+extern bool no_hash_pointers;
+
static int __printf(4, 0) __init
do_test(int bufsize, const char *expect, int elen,
const char *fmt, va_list ap)
@@ -301,6 +303,12 @@ plain(void)
{
int err;
+ if (no_hash_pointers) {
+ pr_warn("skipping plain 'p' tests");
+ skipped_tests += 2;
+ return;
+ }
+
err = plain_hash();
if (err) {
pr_warn("plain 'p' does not appear to be hashed\n");