From: Ingo Molnar <mingo@elte.hu>
To: Dave Young <hidave.darkstar@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] printk: add halt_delay parameter for printk delay in halt phase
Date: Tue, 2 Jun 2009 12:56:09 +0200 [thread overview]
Message-ID: <20090602105609.GA9182@elte.hu> (raw)
In-Reply-To: <a8e1da0906020254s34dd0cd9id1b88655cab6d72d@mail.gmail.com>
* Dave Young <hidave.darkstar@gmail.com> wrote:
> Add a halt_delay module parameter in printk.c used to read the printk
> messages in halt/poweroff/restart phase, delay each printk messages
> by halt_delay milliseconds. It is useful for debugging if there's no
> other way to dump kernel messages that time.
nice idea! We frequently have kernel-death warnings/messages that
scroll off too fast and which cannot be captured.
> halt_delay default value is 0, change it by:
>
> echo xxx > /sys/module/printk/parameters/halt_delay
>
> Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
> ---
> kernel/printk.c | 21 +++++++++++++++++++++
> lib/Kconfig.debug | 10 ++++++++++
> 2 files changed, 31 insertions(+)
>
> --- linux-2.6.orig/kernel/printk.c 2009-04-09 16:23:03.000000000 +0800
> +++ linux-2.6/kernel/printk.c 2009-06-02 17:45:54.000000000 +0800
> @@ -250,6 +250,26 @@ static inline void boot_delay_msec(void)
> }
> #endif
>
> +#ifdef CONFIG_HALT_PRINTK_DELAY
(this #ifdef is ugly - see below.)
> +/* msecs delay after each halt/poweroff/restart phase printk */
> +static unsigned int halt_delay;
> +
> +static inline void halt_delay_msec(void)
> +{
> + if (halt_delay == 0 || !(system_state == SYSTEM_HALT
> + || system_state == SYSTEM_POWER_OFF
> + || system_state == SYSTEM_RESTART))
> + return;
> +
> + mdelay(halt_delay);
>
> boot_delay_msec();
> + halt_delay_msec();
i think it should be done in boot_delay_msec() and the function
should be renamed to print_delay_msec() or so.
> preempt_disable();
> /* This stops the holder of console_sem just where we want him */
> --- linux-2.6.orig/lib/Kconfig.debug 2009-05-12 11:27:22.000000000 +0800
> +++ linux-2.6/lib/Kconfig.debug 2009-06-02 17:50:15.000000000 +0800
> @@ -647,6 +647,16 @@ config BOOT_PRINTK_DELAY
> BOOT_PRINTK_DELAY also may cause DETECT_SOFTLOCKUP to detect
> what it believes to be lockup conditions.
>
> +config HALT_PRINTK_DELAY
> + bool "Delay halt/poweroff/restart printk message by N milliseconds"
> + depends on DEBUG_KERNEL && PRINTK && SYSFS
> + default n
> + help
> + This build option allows you to read kernel messages in
> + halt/poweroff/restart phase by inserting a short delay after
> + each one. The delay is specified in milliseconds on the
> + module parameter: /sys/module/printk/halt_delay.
No need for a Kconfig option - this should be an unconditional
feature like boot-delay.
This will further simplify the patch and will get rid of that ugly
#ifdef.
Ingo
next prev parent reply other threads:[~2009-06-02 10:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-02 9:54 [PATCH] printk: add halt_delay parameter for printk delay in halt phase Dave Young
2009-06-02 10:56 ` Ingo Molnar [this message]
2009-06-02 13:27 ` Dave Young
2009-06-02 14:22 ` Ingo Molnar
2009-06-11 14:43 ` Pavel Machek
2009-06-12 1:21 ` Dave Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090602105609.GA9182@elte.hu \
--to=mingo@elte.hu \
--cc=hidave.darkstar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.