From: Peter Zijlstra <peterz@infradead.org>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Prarit Bhargava <prarit@redhat.com>,
John Stultz <john.stultz@linaro.org>,
lkml <linux-kernel@vger.kernel.org>,
Mark Salyzyn <salyzyn@android.com>,
Jonathan Corbet <corbet@lwn.net>, Petr Mladek <pmladek@suse.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Stephen Boyd <sboyd@codeaurora.org>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
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>,
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: Tue, 8 Aug 2017 10:28:03 +0200 [thread overview]
Message-ID: <20170808082803.opp33rd3g64pe7bw@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20170807203639.GY3730@linux.vnet.ibm.com>
On Mon, Aug 07, 2017 at 01:36:39PM -0700, Paul E. McKenney wrote:
> On Mon, Aug 07, 2017 at 04:06:09PM -0400, Prarit Bhargava wrote:
> > peterz? Want to offer a suggestion? The issue is that I'm changing a bool
> > config option to an int and that impacts all the arch's defconfigs. John points
> > out that this is a lot of churn and we're both wondering if there's a better way
> > to do the configs.
>
> The usual approach is to keep the old bool Kconfig option, and add another
> int Kconfig option that depends on the original one. The tests for
> the int value get a bit more complex, but one way to handle this is to
> define a cpp macro something like the following:
>
> #ifdef CONFIG_OLD_OPTION
> #define CPP_NEW_OPTION 0
> #else
> #define CPP_NEW_OPTION CONFIG_NEW_OPTION
> #endif
>
> Then use CPP_NEW_OPTION, where zero means disabled and other numbers
> select the available options.
>
> Adjust to suit depending on what values mean what.
>
> Another approach is to make the range of the new Kconfig option
> depend on the old option:
>
> config NEW_OPTION
> int "your description here"
> range 1 5 if OLD_OPTION
> range 0 0 if !OLD_OPTION
> default 0
> help
> your help here
>
> Again, adjust to suit depending on what values mean what.
Right this. Except I don't see the !OLD_OPTION working as expected.
A 'new' config will not include the old one, so the !OLD_OPTION thing
will 'always' be true.
So your:
> @@ -1,8 +1,46 @@
> menu "printk and dmesg options"
>
> +choice
> + prompt "printk default clock"
> + config PRINTK_TIME_DISABLE
> + bool "Disabled"
> + help
> + Selecting this option disables the time stamps of printk().
> +
> + config PRINTK_TIME_LOCAL
> + bool "Local Clock"
> + help
> + Selecting this option causes the time stamps of printk() to be
> + stamped with the unadjusted hardware clock.
> +
> + config PRINTK_TIME_BOOT
> + bool "CLOCK_BOOTTIME"
> + help
> + Selecting this option causes the time stamps of printk() to be
> + stamped with the adjusted boottime clock.
> +
> + config PRINTK_TIME_MONO
> + bool "CLOCK_MONOTONIC"
> + help
> + Selecting this option causes the time stamps of printk() to be
> + stamped with the adjusted monotonic clock.
> +
> + config PRINTK_TIME_REAL
> + bool "CLOCK_REALTIME"
> + help
> + Selecting this option causes the time stamps of printk() to be
> + stamped with the adjusted realtime clock.
> +
> +endchoice
> +
> config PRINTK_TIME
Change that into something like:
config PRINTK_CLOCK
> - bool "Show timing information on printks"
> + int "Show time stamp information on printks"
> depends on PRINTK
> + default 0 if PRINTK_TIME_DISABLE
> + default 1 if PRINTK_TIME_LOCAL
And that into:
default 1 if PRINTK_TIME_LOCAL || PRINTK_TIME
> + default 2 if PRINTK_TIME_BOOT
> + default 3 if PRINTK_TIME_MONO
> + default 4 if PRINTK_TIME_REAL
> help
> Selecting this option causes time stamps of the printk()
Then the old PRINTK_TIME symbol will auto-convert into the new
equivalent.
next prev parent reply other threads:[~2017-08-08 8:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 15:52 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 [this message]
2017-08-08 23:08 ` Prarit Bhargava
2017-08-09 17:28 ` Paul E. McKenney
2017-08-07 16:58 ` Mark Salyzyn
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=20170808082803.opp33rd3g64pe7bw@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--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=pmladek@suse.com \
--cc=prarit@redhat.com \
--cc=rostedt@goodmis.org \
--cc=salyzyn@android.com \
--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
all inboxes | Powered by JetHome®