Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751734Ab3F3Rqg (ORCPT ); Sun, 30 Jun 2013 13:46:36 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:43125 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827Ab3F3Rqf (ORCPT ); Sun, 30 Jun 2013 13:46:35 -0400 MIME-Version: 1.0 Reply-To: kerolasa@gmail.com In-Reply-To: References: <1372511678-2726-1-git-send-email-kerolasa@iki.fi> <8761wxxafc.fsf@xmission.com> Date: Sun, 30 Jun 2013 18:46:34 +0100 X-Google-Sender-Auth: gaQIiIqr_eVfRp38rcmZjCe8Y9Q Message-ID: Subject: Re: [PATCH] proc: make high precision system boot time available From: Sami Kerola To: Kay Sievers Cc: "Eric W. Biederman" , linux-kernel@vger.kernel.org, Karel Zak , Lennart Poettering Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1607 Lines: 39 On 30 June 2013 16:10, Kay Sievers wrote: > On Sat, Jun 29, 2013 at 10:53 PM, Sami Kerola wrote: > >> BTW having a way to measure effect of suspend/resume could lead to a >> way to fix time time distortion. > >> Perhaps there is better alternative to fix user space programs. >> Unfortunately I do not have either knowledge, or imagination, to come >> up with any. Fix hints, ideas, and other proposal are most welcome. > > Stuff should just use: > clock_gettime(CLOCK_BOOTTIME, &ts); > > to get the time in better resolution, and with suspend time taken into account? > > As a general note, the kmsg/printk() time in the raw kernel log is the > time of the CPU it runs on, especially during early init this time > might not be in sync across CPUs and stuff jumps event in the very > same stream on events from the kernel itself: > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/sched/clock.c#n329 Thank you Kay, The clock_gettime(CLOCK_BOOTTIME, &uptime); seems to be exactly what dmesg needs. A patch to fix dmesg wigging will be sent to util-linux maillist shortly. Perhaps the dmesg / journald time stamp difference issue will be fixed someday, but that discussion does not belong to linux-kernel mailist, so it is time to declare end of thread. -- Sami Kerola http://www.iki.fi/kerolasa/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/