mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: Petr Mladek <pmladek@suse.com>
Cc: linux-kernel@vger.kernel.org, Mark Salyzyn <salyzyn@android.com>,
	Jonathan Corbet <corbet@lwn.net>,
	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 3/3 v12] printk: Add monotonic, boottime, and realtime timestamps
Date: Tue, 26 Sep 2017 08:55:25 -0400	[thread overview]
Message-ID: <c62ac962-0368-7667-de3e-1f97f4d5b032@redhat.com> (raw)
In-Reply-To: <20170926114842.GB13820@pathway.suse.cz>



On 09/26/2017 07:48 AM, Petr Mladek wrote:
> On Mon 2017-09-18 13:51:00, Prarit Bhargava wrote:
>> printk.time=1/CONFIG_PRINTK_TIME=1 adds a unmodified local hardware clock
>> timestamp to printk messages.  The local hardware clock loses time each
>> day making it difficult to determine exactly when an issue has occurred in
>> the kernel log, and making it difficult to determine how kernel and
>> hardware issues relate to each other in real time.
>>
>> Make printk output different timestamps by adding options for no
>> timestamp, the local hardware clock, the monotonic clock, the boottime
>> clock, and the real clock.  Allow a user to pick one of the clocks by
>> using the printk.time kernel parameter.  Output the type of clock in
>> /sys/module/printk/parameters/time so userspace programs can interpret the
>> timestamp.
>>
>> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
>> index 512f7c2baedd..5e0bf2ef02f7 100644
>> --- a/kernel/printk/printk.c
>> +++ b/kernel/printk/printk.c
>> @@ -1201,14 +1204,130 @@ static inline void boot_delay_msec(int level)
>> +static int printk_time = CONFIG_PRINTK_TIME_TYPE;
>> +
>> +static int printk_set_ts_source(enum timestamp_sources ts_source)
>> +{
>> +	int err = 0;
> 
> 
>> @@ -1861,6 +1980,7 @@ static size_t msg_print_text(const struct printk_log *msg,
>>  			     bool syslog, char *buf, size_t size) { return 0; }
>>  static bool suppress_message_printing(int level) { return false; }
>>  
>> +static int printk_time;
> 
> I worried if the variable should have got initialized. But it seems to
> be a relic from an older version. The variable is not longer used and
> needed when CONFIG_PRINTK is not defined. It is proved by gcc:
> 
>   CC      kernel/printk/printk.o
> kernel/printk/printk.c:1983:12: warning: ‘printk_time’ defined but not used [-Wunused-variable]
>  static int printk_time;
> 

I didn't catch that :(.  tglx, want a v14?

P.

> 
>>  #endif /* CONFIG_PRINTK */
>>  
>>  #ifdef CONFIG_EARLY_PRINTK
> 
> Otherwise that patch looks fine. With the unused variable removed,
> feel free to use:
> 
> Reviewed-by: Petr Mladek <pmladek@suse.com>
> 
> Best Regards,
> Petr
> 

  reply	other threads:[~2017-09-26 12:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 17:50 [PATCH 0/3 v12] printk: Add new timestamps Prarit Bhargava
2017-09-18 17:50 ` [PATCH 1/3 v12] time: Make fast functions return 0 before timekeeping is initialized Prarit Bhargava
2017-09-18 17:50 ` [PATCH 2/3 v12] timekeeping: Provide NMI safe access to clock realtime Prarit Bhargava
2017-09-18 17:51 ` [PATCH 3/3 v12] printk: Add monotonic, boottime, and realtime timestamps Prarit Bhargava
2017-09-26 11:48   ` Petr Mladek
2017-09-26 12:55     ` Prarit Bhargava [this message]
2017-09-29 12:46   ` Pavel Machek

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=c62ac962-0368-7667-de3e-1f97f4d5b032@redhat.com \
    --to=prarit@redhat.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=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®