From: Mark Salyzyn <salyzyn@android.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Petr Mladek <pmladek@suse.com>,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Prarit Bhargava <prarit@redhat.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [GIT pull] printk updates for 4.15
Date: Wed, 15 Nov 2017 08:26:56 -0800 [thread overview]
Message-ID: <e3023e33-149a-e741-b937-1244797ef9c2@android.com> (raw)
In-Reply-To: <CA+55aFzAvSe9WjSgyUHns+Z3LbpMFWSU_uze0B8XTRzbnk3rVg@mail.gmail.com>
On 11/14/2017 04:00 PM, Linus Torvalds wrote:
> On Tue, Nov 14, 2017 at 2:50 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> +/*
>> + * struct timestanps - Simultaneous mono/boot/real timestamps
>> + * @mono: Monotonic timestamp
>> + * @boot: Boottime timestamp
>> + * @real: Realtime timestamp
>> + */
> Side note: does anybody really wanr/need the boottime thing?
"Android partners have asked for it". I have said no...
Maybe for completeness, but having it may straighten out a
synchronization mess.
[TL;DR]
"If you have three watches, you will never know what time it is"(tm)
Android peripherals with embedded firmware (camera, sensor hub, etc) all
are run synchronized to boottime. If the firmware logs any data and it
is propagated, we run into issues trying to triage firmware, kernel and
user space temporal activities as each is on a different timebase.
Android's logger cluster (logd) today can only be switched between
CLOCK_REALTIME or CLOCK_MONOTONIC for its timebase. It tries to track
the pair to merge content from all the sources. use is mixed:
CLOCK_REALTIME is selected on phones/tablets, CLOCK_MONOTONIC is
selected on watches. CLOCK_BOOTIME to make a trio of synchronized time
sources is being requested.
We are blocked on introducing CLOCK_BOOTTIME as an option because it is
difficult to discern between logging utilizing CLOCK_BOOTTIME or
CLOCK_MONOTONIC based on incoming value alone (heuristics) so the
infrastructure will change. Logging (in user space) the trio of
timestamps is too costly (2.5us, currently CLOCK_BOOTTIME is not
supplied by vdso, so is a syscall) and some sources will never report
the trio. (I have patches that fix CLOCK_BOOTTIME in vdso being
considered in the vdso-unification effort)
CLOCK_BOOTTIME and CLOCK_MONOTONIC represent an issue for continuity
through a reboot or kernel crash. Stitching them together sometimes
generates maniacal laughter. CLOCK_REALTIME is not set until a LTE
connection is made, so we are effectively seeing CLOCK_BOOTTIME (or
worse, some random offset) logging until later in the boot cycle.
Currently kernel logs and atrace (kernel ftrace + a user merged
component) are CLOCK_MONOTONIC.
I do not know if we will ever unify the timebases. Or select one
(CLOCK_BOOTTIME has been suggested as the best choice). kernel
supporting it, or the trio, in logd.auditd and logd.klogd threads would
be a step towards a better and synchronized logging world though.
-- Mark
next prev parent reply other threads:[~2017-11-15 16:27 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 9:36 [GIT pull] printk updates for 4.15 Thomas Gleixner
2017-11-14 1:18 ` Linus Torvalds
2017-11-14 2:48 ` Linus Torvalds
2017-11-14 10:03 ` Petr Mladek
2017-11-14 13:28 ` Prarit Bhargava
2017-11-14 15:56 ` Mark Salyzyn
2017-11-15 0:48 ` Sergey Senozhatsky
2017-11-14 17:20 ` Linus Torvalds
2017-11-14 20:21 ` Thomas Gleixner
2017-11-14 21:07 ` Linus Torvalds
2017-11-14 21:09 ` Thomas Gleixner
2017-11-14 21:16 ` Mark Salyzyn
2017-11-14 21:29 ` Linus Torvalds
2017-11-14 22:10 ` Mark Salyzyn
2017-11-14 22:37 ` Linus Torvalds
2017-11-14 22:50 ` Thomas Gleixner
2017-11-14 23:00 ` Joe Perches
2017-11-14 23:00 ` Linus Torvalds
2017-11-14 23:04 ` Thomas Gleixner
2017-11-14 23:18 ` Linus Torvalds
2017-11-14 23:22 ` Thomas Gleixner
2017-11-15 0:00 ` Linus Torvalds
2017-11-15 8:04 ` Ingo Molnar
2017-11-15 16:26 ` Mark Salyzyn [this message]
2017-11-15 17:42 ` Linus Torvalds
2017-11-16 0:37 ` Thomas Gleixner
2017-11-16 1:23 ` John Stultz
2017-11-16 1:32 ` Linus Torvalds
2017-11-16 7:12 ` Thomas Gleixner
2017-11-18 0:26 ` Thomas Gleixner
2017-11-18 0:44 ` Linus Torvalds
2017-11-18 1:00 ` Thomas Gleixner
2017-11-20 6:20 ` Kevin Easton
2017-11-20 6:36 ` Linus Torvalds
2018-01-29 20:34 ` Mark Salyzyn
2018-01-29 21:49 ` Thomas Gleixner
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=e3023e33-149a-e741-b937-1244797ef9c2@android.com \
--to=salyzyn@android.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=prarit@redhat.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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