]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kernel/async.c: stop guarding pr_debug() statements
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 13 Apr 2021 22:21:29 +0000 (08:21 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Apr 2021 22:21:29 +0000 (08:21 +1000)
commit6c3020c56204d8a4780fad1f8b357cada1aed256
treee5fbe9c1ef8fc561aaa840dc36325748a62f763c
parentdb397ae8a80f49682ba1c45de0d468acc73b07af
kernel/async.c: stop guarding pr_debug() statements

It's currently nigh impossible to get these pr_debug()s to print
something.  Being guarded by initcall_debug means one has to enable tons
of other debug output during boot, and the system_state condition further
means it's impossible to get them when loading modules later.

Also, the compiler can't know that these global conditions do not change,
so there are W=2 warnings

kernel/async.c:125:9: warning: `calltime' may be used uninitialized in this function [-Wmaybe-uninitialized]
kernel/async.c:300:9: warning: `starttime' may be used uninitialized in this function [-Wmaybe-uninitialized]

Make it possible, for a DYNAMIC_DEBUG kernel, to get these to print their
messages by booting with appropriate 'dyndbg="file async.c +p"' command
line argument.  For a non-DYNAMIC_DEBUG kernel, pr_debug() compiles to
nothing.

This does cost doing an unconditional ktime_get() for the starttime value,
but the corresponding ktime_get for the end time can be elided by
factoring it into a function which only gets called if the printk()
arguments end up being evaluated.

Link: https://lkml.kernel.org/r/20210309151723.1907838-1-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
kernel/async.c