From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751606AbdIOO3r (ORCPT ); Fri, 15 Sep 2017 10:29:47 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:56634 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbdIOO3p (ORCPT ); Fri, 15 Sep 2017 10:29:45 -0400 X-Google-Smtp-Source: ADKCNb4qoLLQd/nPgmT9H8M2JM7T5LHvdM7dCr394whg9wFXbfZ/j9iUxwyPJ4aeZRdRiGIXSGo8rw== Subject: Re: [PATCH 3/3 v11] printk: Add monotonic, boottime, and realtime timestamps To: Petr Mladek , Prarit Bhargava Cc: linux-kernel@vger.kernel.org, Jonathan Corbet , Sergey Senozhatsky , Steven Rostedt , John Stultz , Thomas Gleixner , Stephen Boyd , Andrew Morton , Greg Kroah-Hartman , "Paul E. McKenney" , Christoffer Dall , Deepa Dinamani , Ingo Molnar , Joel Fernandes , Kees Cook , Peter Zijlstra , Geert Uytterhoeven , "Luis R. Rodriguez" , Nicholas Piggin , "Jason A. Donenfeld" , Olof Johansson , Josh Poimboeuf , linux-doc@vger.kernel.org References: <1504613201-23868-1-git-send-email-prarit@redhat.com> <1504613201-23868-4-git-send-email-prarit@redhat.com> <20170915132808.GL2908@pathway.suse.cz> From: Mark Salyzyn Message-ID: <4cf75f3b-7d46-9e6c-3929-881f013f1c77@android.com> Date: Fri, 15 Sep 2017 07:29:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170915132808.GL2908@pathway.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/15/2017 06:28 AM, Petr Mladek wrote: > I am still slightly nervous that external tools would need updating. > Also they might have troubles to interpret the time stamps especially > when the source is changed at runtime via > /sys/module/printk/parameters/time. My comment below is a rehash/summary: In the discussion, it appears that DAC protection is enough to prevent flippant changes. The use cases I can imagine for runtime alteration fall in two groups, late boot changes after all disks are mounted and the application layers have started; or as an aid to debugging where the deliberate nature can be accounted for. Change it, erase the logs is the KISS solution, so the tools do not have to 'sniff' the stream for dynamic changes, likely getting the 'leader' wrong, checking /sys/module/printk/parameters/time for the current/last timebase. To mitigate the 'leader' issue, or post-mortem/off-machine interpretation, really for the debugging corner case IMHO, I had proposed that local, and perhaps monotonic, time print as-is as they are almost(?) imperceptibly different, but that realtime add a U suffix (to denote time is UTC), and that boottime add a B suffix (well, because) so that tools can discern. Monotonic could have a M suffix if it is really a stickler. This proposal would require more disruptive tool modifications and should be scoped as a separate effort. I do expect a debate regarding upper and lower case ... I have a patch waiting in the wings here where disruptive time changes (suspend/resume/hibernate/restore; maybe date(1), ntpd(8) or embedded systems LTE hardware time updates) will report dual timestamps so that resynchronization and tracking can happen in post-mortem on the stream, I expect to use the above proposal for the 'second' occasional timestamp. -- Mark