Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp7319219imm; Mon, 21 May 2018 00:13:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpY7+sDSUlnU3Gnsm4tJ98iaDP9fDlCbKLDTqd2SrSHOR6ZEUqrX6mtAZUyQTUCm23+nO/S X-Received: by 2002:a63:2783:: with SMTP id n125-v6mr14580810pgn.377.1526886832116; Mon, 21 May 2018 00:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526886832; cv=none; d=google.com; s=arc-20160816; b=Lr3dSrfa0sXs+sbocnEVYH2uXeMcWZ3/ligxxprygdZUnD1JLYGuaL5gve2Qmx7lNm rw5/vIa3C7PDUBaImHeaAxdQZbqWdrPZ2fYjH5aiOr2fXaxHLA8UJ0dnj1KpXbtx1r9G g+gRF8/CKf6z2KKJxbuklYPUpSqREXkC9z9ObtISMATxw/Q2aRLRfOBDtJFjWLFgULWP On+zeTD/Hs7GDIM6nKZI41DGcdXhRYtG+dKaeqWgBidU0i2KtXAp1xu+h/ZXdWx98EKb mAWwXMo20N/vNvhSnyE7mhSmBS1RcHxve8w2ovAJ+74uh64GO9ORDyd/8OAhECt89cPG hYSw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yw/ad7ZHLJ3itvy1GJW4ANEZ/GhPDHTLgP2qTnmpV1c=; b=KKu0+4sQ1lcD3Spqjt4KcAfQYQL+BjoM9gS8sGpYbYEYQ9fI6ifiFwmhqHNIvaeMy0 FF/MxitZ/awvUccDk5gRK1AGkI3gOmfXtiDdczbsyIAWDR8u4juzMzumjcnShtt6X4f8 CGh9bE8DqCQXh7lVEARjgjsEP4X7xKSgzLLhbmN+dVmherwwk9DX0uJT9r8E+059CwPk smNx9DflLVtRYQl6v1YlG5MnGbs2k+kR49iArKSTpFyNjT5W5yFDlmPtVDDG64LxSBuo 6aTS0CJm3OjtykIBm1Rf+ImQZ0KP4NESbtZpBMSmcKXW11L93BLCZ4l0hJ+Or0kn3xNF R1yQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f69-v6si13791849plb.503.2018.05.21.00.13.37; Mon, 21 May 2018 00:13:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751072AbeEUHNT (ORCPT + 99 others); Mon, 21 May 2018 03:13:19 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:40392 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbeEUHNS (ORCPT ); Mon, 21 May 2018 03:13:18 -0400 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 4F631608D732; Mon, 21 May 2018 09:13:16 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id DcKO0WGYjftQ; Mon, 21 May 2018 09:13:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id ECF35608D741; Mon, 21 May 2018 09:13:15 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TruOnhJGjGXr; Mon, 21 May 2018 09:13:15 +0200 (CEST) Received: from blindfold.localnet (213-47-184-186.cable.dynamic.surfer.at [213.47.184.186]) by lithops.sigma-star.at (Postfix) with ESMTPSA id C9E05608D732; Mon, 21 May 2018 09:13:15 +0200 (CEST) From: Richard Weinberger To: Stefan Schaeckeler Cc: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mtd: mtdoops: optionally dump boottime Date: Mon, 21 May 2018 09:13:09 +0200 Message-ID: <5252756.S0IrdeWEj0@blindfold> In-Reply-To: <20180521022924.GA33758@sjc-ads-587.cisco.com> References: <20180521022924.GA33758@sjc-ads-587.cisco.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stefan, Am Montag, 21. Mai 2018, 04:29:24 CEST schrieb Stefan Schaeckeler: > Hello Richard and others, > > > I get the use-case, but why is this only for mtdoops? > > Powerpc's nvram module also stores oops messages and does so by adding an > additional timestamp, as well (search for kmsg_dump_get_buffer() in > arch/powerpc/kernel/nvram_64.c). Just one more reason to make it generic. > This timestamp is the number of seconds since 1970 and stored as a 64 bit > integer in the nvram header. Basically, the last kmesg timestamp is a few ms > less than this additionally stored timestamp. Recording boottime would be more > elegant, I guess. > > > > IMHO this needs to go into generic code such that all kmsg dumpers can > > benefit from it. > > This would be not that easy: > > #1 kmsg_dump_get_buffer(...size...) returns the most recent bytes. > Consecutive calls return older chunks. It would be natural to return the > boottime as the first line, e.g. in the last call, but some clients such as > mtdoops call kmsg_dump_get_buffer() only once. The returned buffer may be > complete including boottime, or not. > > #2 consistency with other clients: nvram_64.c has the same requirement of > storing a kind of wall-time but does it in a completely different way: no > readable ascii text timestamp preprended to the kmsg buffer but a 64 bit > timestamp in its header. Note, I don't think we should make mtdoops behave like > nvram_64.c by storing the timestamp as a 64 bit integer (in its header) b/c > most people do a cat or string of the mtd device /dev/mtdX and a 64 bit integer > would just read as garbage. I think this is the perfect opportunity to talk with other kmesg dump users on how to add a timestamp. As last resort we can always do it in our own way but I think making it generic is at lest worth a try... > I hope we can have separate implementations for recording additional > timestamps. Later, I'll send a patch with stylistic changes unless we > completely disagree on how to move forward. Both #1 and #2 aren't show-stoppers. Thanks, //richard