Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1211035ybg; Thu, 4 Jun 2020 04:06:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG28kv2QGXzWlQsWcCxDNNPG6QyQ3NgfGzWr7gL5uSbDoiabrSXHwjWW+0gm1mDAFuy/HP X-Received: by 2002:a50:fb0b:: with SMTP id d11mr3884489edq.118.1591268768824; Thu, 04 Jun 2020 04:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591268768; cv=none; d=google.com; s=arc-20160816; b=C+YRMQrqL9adUSOvFFwVyFMN9a+pSxu0/mavmQS6/obiT3m3jfW70fnsXmXxjPB4ja oPrmz2lklVvP6AJUWACnvKNA5MR3FS5UBACnN8LxuyNZ1J3C0ddG4G8lq/O0ooFb7J5C TUvd10/NuG4vMCpEVvUTkcs1kitk2EcTNXBD93MZ9BeyXrXonAtChgisRlhe98fNK12x 9rqC3flA1sYZnI9fbWNzGOn/N1MzFzEhx2tsmVkZ7nYGCVTtpBnaMNdAXXj46hc2A7BG H+JrfMHeLvHm83FKT5JqB39LnVGo9zZPlh273Z4rOmnJlFPs00EhTSXe9vsv242QS3cU AI5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gSUt/M2frPtSsqZnHp0XYXCk18yFWUkSIdMBdFgZ1wg=; b=MPopWh5iYr7LDKSJjAOOtAbePW4s/Bnh8NqRgyc89w5Gz5+o2tKyZchoqBkSbXzUVO Q1VgO69ryN+nzHh7T1/B8oC2qaeGabwEXVKiX4bLvKlMHWko6dys0PDHXxQFvio7aXId nmR68GIsdTxCt8Hw3tLUdhFQY7Goe0L5CUTkb00eY+URjDPddWhJx8Nvs3Sr5erO2Z6C Qnr12aEuZUZI/FbE4EUSqPdyGCKdg8XX/kdC179TajlJFtcqJNreNcQyFizC5PgkpYyS 0eqp7MQ11Lhks1SurStW8iu0N+OKFEwknWntecn0V+dCLm5HG/s9n8N4tq5DZ45XDanZ RNiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NNO9WfoC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce14si1684567edb.101.2020.06.04.04.05.34; Thu, 04 Jun 2020 04:06:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NNO9WfoC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728082AbgFDKVe (ORCPT + 99 others); Thu, 4 Jun 2020 06:21:34 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:26541 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726236AbgFDKVV (ORCPT ); Thu, 4 Jun 2020 06:21:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591266080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gSUt/M2frPtSsqZnHp0XYXCk18yFWUkSIdMBdFgZ1wg=; b=NNO9WfoCFvLPZfQd46Q+iR0TpeJvuTQaARghA0NNondMMSvOPZHd+H2TkibrRu1lOyWC5T LXScGpVmgqVKM7VMp1hZMt18Ys4Wpew7w0+dxyzht83phyN4o/MIl6ZGvER1HHFDEd/jec OnVOPWB4v0oVqvEB/uyoZbZEQirEQqs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-211-YLGD09sgMU-beIe59zbfHg-1; Thu, 04 Jun 2020 06:21:16 -0400 X-MC-Unique: YLGD09sgMU-beIe59zbfHg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07FAF800C78; Thu, 4 Jun 2020 10:21:15 +0000 (UTC) Received: from ws.net.home (unknown [10.40.194.133]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 075E02DE71; Thu, 4 Jun 2020 10:21:13 +0000 (UTC) Date: Thu, 4 Jun 2020 12:21:11 +0200 From: Karel Zak To: Konstantin Khlebnikov Cc: util-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH util-linux] dmesg: adjust timestamps according to suspended time Message-ID: <20200604102111.vst3goseqfxz5fa4@ws.net.home> References: <159103929487.199093.15757669576783156290.stgit@buzz> <20200604093043.55a4zzo2hewhcwru@ws.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 04, 2020 at 12:43:52PM +0300, Konstantin Khlebnikov wrote: > On 04/06/2020 12.30, Karel Zak wrote: > > On Mon, Jun 01, 2020 at 10:21:34PM +0300, Konstantin Khlebnikov wrote: > > > Timestamps in kernel log comes from monotonic clocksource which does not > > > tick when system suspended. Suspended time easily sums into hours and days > > > rendering human readable timestamps in dmesg useless. > > > > > > Adjusting timestamps accouring to current delta between boottime and > > > monotonic clocksources produces accurate timestamps for messages printed > > > since last resume. Which are supposed to be most interesting. > > > > It's definitely better than the current broken timestamps, but the real > > and final solution is to have exact information about system suspends. > > > > It would be enough to maintain in kernel memory a simple log with > > > > and export this info by /proc/suspendlog, after that we can all > > re-count /dev/kmsg timestamps to something useful. > > Boottime or real time could be simply printed into kernel log at > suspend and resume. So demsg could detect current offset while reading. Yes, but not sure if this is the most robust way (dmesg --clear will remove this info) and I guess the suspendlog can be useful independently on kmsg. Karel -- Karel Zak http://karelzak.blogspot.com