[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 8 Aug 2017 09:46:22 -0400
From: Prarit Bhargava <prarit@...hat.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: linux-kernel@...r.kernel.org, Mark Salyzyn <salyzyn@...roid.com>,
Jonathan Corbet <corbet@....net>,
Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
John Stultz <john.stultz@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...eaurora.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Christoffer Dall <cdall@...aro.org>,
Deepa Dinamani <deepa.kernel@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Joel Fernandes <joelaf@...gle.com>,
Kees Cook <keescook@...omium.org>,
Peter Zijlstra <peterz@...radead.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
"Luis R. Rodriguez" <mcgrof@...nel.org>,
Nicholas Piggin <npiggin@...il.com>,
"Jason A. Donenfeld" <Jason@...c4.com>,
Olof Johansson <olof@...om.net>,
Josh Poimboeuf <jpoimboe@...hat.com>, linux-doc@...r.kernel.org
Subject: Re: [PATCH v4] printk: Add monotonic, boottime, and realtime
timestamps
On 08/07/2017 08:19 PM, Sergey Senozhatsky wrote:
> On (08/07/17 11:52), Prarit Bhargava wrote:
<snip>
> [..]
>> + if (strlen(param) == 1) {
>> + /* Preserve legacy boolean settings */
>> + if (!strcmp("0", param) || !strcmp("n", param) ||
>> + !strcmp("N", param))
>> + _printk_time = PRINTK_TIME_DISABLE;
>> + if (!strcmp("1", param) || !strcmp("y", param) ||
>> + !strcmp("Y", param))
>> + _printk_time = PRINTK_TIME_LOCAL;
>> + }
>> + if (_printk_time == -1) {
>> + for (stamp = 0; stamp <= 4; stamp++) {
>> + if (!strncmp(printk_time_str[stamp], param,
>> + strlen(param))) {
>> + _printk_time = stamp;
>> + break;
>> + }
>> + }
>> + }
>
> you can use match_string() here.
match_string doesn't match correctly. Others have made requests for, for
example, printk.time=r printk.time=real, etc. Instead of butchering the code
for a bunch of strings I chose to allow partial matching and simplify the code.
P.
Powered by blists - more mailing lists