Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1165996ybg; Thu, 4 Jun 2020 02:46:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEhGK9kmXx9aa9iDYHijiQj4krJiETs8BHnf54XDsrLo6LsVGaENl0JYd/76GNqO9QWGwp X-Received: by 2002:a17:906:5652:: with SMTP id v18mr3029209ejr.72.1591264015304; Thu, 04 Jun 2020 02:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591264015; cv=none; d=google.com; s=arc-20160816; b=OiH+3/nt82SBJeUlmY7t/HGEnWdKeJunwLm4zvF/iKWLzBMCIjde+CZ94czvplTDui Zrx1FqVchZ35ZRk9E3+819D0eYMyGWQWgBMXdfI/6502utXX0ip1hd+FMU+oIYy9IcDW OJb8zvXfF7E/UiXMTniZzbMzybOeXvp3DUtZ+aYdWks45hsolH8GiUqV+JTdUwZDC6ui InZnkkqlVpSSE/cdtZEuMfKubCSvZIM9U69Gt0vLGLif32esBxrlgCbDn/3CdSqbOpIy JJ14dAckexfVwODvDQXJi2ji8txKIfBxXm9QK16cEuMNNPa9kB+DCI0E57LMHaQMTwb3 RTBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=b3DXVvqT1EzaVn2igQ1Ig47zD0kPzfJszibVFHtFWY8=; b=yEJylUYWyrZ/6q0uw++85E/r/joKfjm6Jr3i9QYgerToTxbF+hg0uKiTmHqymWGuQZ CbxDS3U+kOS/9JS2DQZdifPuZgNTAy+6EGKVPqCMRlr72NOQs7KOZcovh+5eYYIsh328 1A+x0Af+U/ITcyVyNRuWaSRqqzsPll0gSwFNgBfxruUKdCy8rfVoPXdQOvN3ul/5cw8z zbR33yXUzt6Qr9SOjF+ItO8NIyOAqNcRIoP1HlTPQLQM4XP9d0F7Xv/XVzenDa7s2xj/ qevZyG4GeS2jr+h6lMOinwfyEHv5wWuoSYKFVqFkgpDpWGov/EiLKXn8DLuPCakY7j/E rkFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=xChTMe0D; 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=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci2si1277980ejc.191.2020.06.04.02.46.32; Thu, 04 Jun 2020 02:46:55 -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=@yandex-team.ru header.s=default header.b=xChTMe0D; 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=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728187AbgFDJn7 (ORCPT + 99 others); Thu, 4 Jun 2020 05:43:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728066AbgFDJn6 (ORCPT ); Thu, 4 Jun 2020 05:43:58 -0400 Received: from forwardcorp1p.mail.yandex.net (forwardcorp1p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b6:217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F050C03E96D for ; Thu, 4 Jun 2020 02:43:58 -0700 (PDT) Received: from mxbackcorp1o.mail.yandex.net (mxbackcorp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::301]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id 8BD552E1515; Thu, 4 Jun 2020 12:43:53 +0300 (MSK) Received: from myt4-18a966dbd9be.qloud-c.yandex.net (myt4-18a966dbd9be.qloud-c.yandex.net [2a02:6b8:c00:12ad:0:640:18a9:66db]) by mxbackcorp1o.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id 8Ys540NFgH-hqx8xeXM; Thu, 04 Jun 2020 12:43:53 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1591263833; bh=b3DXVvqT1EzaVn2igQ1Ig47zD0kPzfJszibVFHtFWY8=; h=In-Reply-To:Message-ID:From:Date:References:To:Subject:Cc; b=xChTMe0DYr9bpfYQnnCLir/iieno7gmgT86rM/Vx5f+krqOL9OelVU3b/dKKX3Xgo vmoOJSA6pGVOpObpJE5v/aOkQi9dwTuBd1AAOpJTNV45QEEnulRh9Yxi6agbtXuHrB AQj/HGnGA1fLLJI1RNqy4WcKtB/z5TyKVYA+za5A= Authentication-Results: mxbackcorp1o.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-vpn.dhcp.yndx.net (dynamic-vpn.dhcp.yndx.net [2a02:6b8:b081:717::1:10]) by myt4-18a966dbd9be.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id rb3AdYrtMr-hqWGl6mq; Thu, 04 Jun 2020 12:43:52 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: [PATCH util-linux] dmesg: adjust timestamps according to suspended time To: Karel Zak Cc: util-linux@vger.kernel.org, linux-kernel@vger.kernel.org References: <159103929487.199093.15757669576783156290.stgit@buzz> <20200604093043.55a4zzo2hewhcwru@ws.net.home> From: Konstantin Khlebnikov Message-ID: Date: Thu, 4 Jun 2020 12:43:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200604093043.55a4zzo2hewhcwru@ws.net.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. But for older kernel dmesg still needs guessing like this. > > Karel > >