From: Mark Salyzyn <salyzyn@android.com>
To: Prarit Bhargava <prarit@redhat.com>, linux-kernel@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>, Petr Mladek <pmladek@suse.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Stephen Boyd <sboyd@codeaurora.org>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Christoffer Dall <cdall@linaro.org>,
Deepa Dinamani <deepa.kernel@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Joel Fernandes <joelaf@google.com>,
Kees Cook <keescook@chromium.org>,
Peter Zijlstra <peterz@infradead.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
"Luis R. Rodriguez" <mcgrof@kernel.org>,
Nicholas Piggin <npiggin@gmail.com>,
"Jason A. Donenfeld" <Jason@zx2c4.com>,
Olof Johansson <olof@lixom.net>,
Josh Poimboeuf <jpoimboe@redhat.com>,
linux-doc@vger.kernel.org
Subject: Re: [PATCH v4] printk: Add monotonic, boottime, and realtime timestamps
Date: Mon, 7 Aug 2017 09:58:31 -0700 [thread overview]
Message-ID: <ff8a31d8-cebe-88bf-fe05-82b0b8d4e3da@android.com> (raw)
In-Reply-To: <1502121162-27981-1-git-send-email-prarit@redhat.com>
On 08/07/2017 08:52 AM, Prarit Bhargava wrote:
> diff --git a/arch/arm/configs/aspeed_g4_defconfig b/arch/arm/configs/aspeed_g4_defconfig
> index cfc2465e8b77..5f3c50914e92 100644
> --- a/arch/arm/configs/aspeed_g4_defconfig
> +++ b/arch/arm/configs/aspeed_g4_defconfig
> @@ -162,7 +162,7 @@ CONFIG_JFFS2_FS_XATTR=y
> CONFIG_UBIFS_FS=y
> CONFIG_SQUASHFS=y
> CONFIG_SQUASHFS_XZ=y
> -CONFIG_PRINTK_TIME=y
> +CONFIG_PRINTK_TIME_LOCAL=y
> CONFIG_DYNAMIC_DEBUG=y
> CONFIG_STRIP_ASM_SYMS=y
> CONFIG_DEBUG_FS=y
Many have had misgivings, let me try another pass at this.
We (royal we) should really look into adjusting configuration parsing to
allow an easy transition from boolean to selection ... I am sure this is
not the first time bistate/tristate was moved to a number.
An idea? Maybe look into a way to deal with this to use something
_other_ than CONFIG_PRINTK_TIME to hold the selection, and keep a
(hidden/legacy?) CONFIG_PRINTK_TIME that when selected sets
CONFIG_PRINTK_TIME_LOCAL, and switch to _not_ CONFIG_PRINTK_TIME_DISABLE
as the internal mechanical replacement for it. I do not know how
disruptive this will be, but is worth it if the codebase supports it,
and legacy config retained?
> +
> +static int printk_time_set(const char *val, const struct kernel_param *kp)
> +{
> + char *param = strstrip((char *)val);
> + int _printk_time = -1;
> + int stamp;
> +
> + if (strlen(param) == 1) {
> + /* Preserve legacy boolean settings */
> + if (!strcmp("0", param) || !strcmp("n", param) ||
if strlen(param) == 1, then param[0] == '0' etc works fine and is KISS.
> + /*
> + * Only allow enabling and disabling of the current printk_time
> + * setting. Changing it from one setting to another confuses
> + * userspace.
> + */
> + if (printk_time_setting == PRINTK_TIME_DISABLE) {
> + printk_time_setting = _printk_time;
> + } else if ((printk_time_setting != _printk_time) &&
> + (_printk_time != 0)) {
> + pr_warn("printk: timestamp can only be set to 0(disabled) or %s\n",
> + printk_time_str[printk_time_setting]);
> + return -EINVAL;
> + }
I agree with the restriction in the general case. However (as hinted at
before() #ifdef CONFIG_PRINTK_TIME_RESTRICT (default y, or #ifndef
CONFIG_PRINTK_TIME_DEBUG default n) around this will allow us users to
choose if we are confused or not. I can see being able to change it on
the fly as an option. Especially since we have
/sys/module/printk/parameters/time.
-- Mark
next prev parent reply other threads:[~2017-08-07 16:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 15:52 [PATCH v4] printk: Add monotonic, boottime, and realtime timestamps Prarit Bhargava
2017-08-07 16:52 ` John Stultz
2017-08-07 17:15 ` Peter Zijlstra
2017-08-07 18:04 ` Prarit Bhargava
2017-08-07 18:47 ` John Stultz
2017-08-07 20:06 ` Prarit Bhargava
2017-08-07 20:36 ` Paul E. McKenney
2017-08-08 8:28 ` Peter Zijlstra
2017-08-08 23:08 ` Prarit Bhargava
2017-08-09 17:28 ` Paul E. McKenney
2017-08-07 16:58 ` Mark Salyzyn [this message]
2017-08-07 18:07 ` Prarit Bhargava
2017-08-07 17:18 ` Peter Zijlstra
2017-08-08 0:19 ` Sergey Senozhatsky
2017-08-08 12:32 ` Prarit Bhargava
2017-08-08 13:46 ` Prarit Bhargava
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=ff8a31d8-cebe-88bf-fe05-82b0b8d4e3da@android.com \
--to=salyzyn@android.com \
--cc=Jason@zx2c4.com \
--cc=akpm@linux-foundation.org \
--cc=cdall@linaro.org \
--cc=corbet@lwn.net \
--cc=deepa.kernel@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=joelaf@google.com \
--cc=john.stultz@linaro.org \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mingo@kernel.org \
--cc=npiggin@gmail.com \
--cc=olof@lixom.net \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=prarit@redhat.com \
--cc=rostedt@goodmis.org \
--cc=sboyd@codeaurora.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox