Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp297659imj; Wed, 13 Feb 2019 08:30:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IYQhbZ+Q+BFUpp9MegZCImhOlsyHQEwFggxxdqm7NrsjeuB/oLMBqvpLb+0M/KvQfRbRGy0 X-Received: by 2002:a17:902:8d8d:: with SMTP id v13mr1290819plo.121.1550075414652; Wed, 13 Feb 2019 08:30:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550075414; cv=none; d=google.com; s=arc-20160816; b=sudvUnjbEt8+lxqiseowDe0K04oJt67nuQR/6HMfOsLv7E+YHcHZ4rDauAiyHEPF22 Xa3xT+gYIkdUVGOihA7a/JLHxH0QAxrfCMCEownBRRhOfKaCkf5vYEVKzzEhIKP5krU+ luf+aMJ+GJ4SgaqMf8/mx6CkqtFrP2lAVReo1WQ59FfcNeQLNSxGqgyBjfTP3b+4VKsG 67TvcCCtaPO28eDgSHUSOmkNu0y6XvkIKrstVe/XMynSb154ErRuodzv+fosyhwZnZ+s Mip7PJr1nwnvTvzYUhf/6cSNyixwrI7fRjhbgfj9QuWXBAIgJDDxQ5xYUViEQ14NSmv3 cFww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=i4mevzt5StSYjMjq+E1SLBDidyPTBhRKkvGDS6UkqGs=; b=Ac6lGeoDGduTT2HmZENQlLm6zCXdM8+MLy66nq1uwX4poAWZzD/CRDEt1tjJFqWBeF QC9K5O77wLxeeOAg/FqaKAVUYK/O+z8OX1/8Q0EugARlcbYiLxGqKZFuWpe0SYrufJB1 WDwdC70pPPlDqHWiw53ui2B0Pxrm1RvQxD3lgYMaDTgqimFeJwA1j5VTJWtRwySZaGWI Ui20VGIQV//4xldL211W3+yCZ+FGT9Ua4IplZbiglFxeZrRkB9f9rDFL15VyFOc4n9ZD ubH9Vpj72r/Z5TgfxXPmBNDrZvjXTlDeTjk6KHOsQZPDHBpWvcWQQxhMJ86Z/TWQ77RO gCCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MQdMGSFq; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si4129958pgw.288.2019.02.13.08.29.58; Wed, 13 Feb 2019 08:30:14 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MQdMGSFq; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392668AbfBMQ0J (ORCPT + 99 others); Wed, 13 Feb 2019 11:26:09 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:37731 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728150AbfBMQ0J (ORCPT ); Wed, 13 Feb 2019 11:26:09 -0500 Received: by mail-qt1-f196.google.com with SMTP id a48so3238561qtb.4 for ; Wed, 13 Feb 2019 08:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i4mevzt5StSYjMjq+E1SLBDidyPTBhRKkvGDS6UkqGs=; b=MQdMGSFqlE5c1cs1fMkXnwxb7WD/KYUN9EmsCsfvZYkAvfG6B/x8NrEfDMtqhwJcEg 9xdFeCC48QyGgGXG1hfTCV6HFFeR0pWd1AyAJw8tw4rsbQu7N/HFpvczR84dYUyw3q9r /Cdxcg9+W5Kukz8mDkYk3t/GNi5t/0ajrfbH4eL2Ck/G+/s/YUrfLcQFQ4G5X16NoRE2 j50Fs16kJV05P/u9nPsFxe/ZeGdvc7OXpi5iJUJPOIMkJvzJHRkjieiHuv2E36OIvYvZ bEDH7o8NOzbrTXrwahSPZYXV/uAy8C7b1Bbb33JxyYXbo8jk4kz/H+Cl6ySICHWFKeqD qBRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i4mevzt5StSYjMjq+E1SLBDidyPTBhRKkvGDS6UkqGs=; b=Aa7wdX4G0tQD5TsP+bc/+byOV0TufhaafBsj7fILuR0qGIhZcFXH35AQB2rHitkk5x F+vMURwGkuc+8Iki2ADUwdyhWuPdJeppyu95BxUepZi5aBPacvA/bnbzniIQaXt3M31Z Jtb6H16PZvmdgkVazQF6x6vGbh8miSUU82B9XWeV3AKJveSvcPHy4OpcZMhMf+dgMEh5 auUbWjMKSvjWi/TksTddTjQxudZ5HjuEe0W8eIRghG1WlGU4np1VwS240YiPajahpVUL y99LX1aBSg5wYUsL41zul/rlyTXFRPIjuWGAM1ssMIpiZGikySbEgkQGXeNkxHNvegOx D5hg== X-Gm-Message-State: AHQUAuZVO8XYvrA1nCTmIyghyZgxWO5vySO3fPgo2xQiQ865T2yfxmey Xjz73GhcjJCasC8tBueOee0qB4z+S/OcPMOOlLM= X-Received: by 2002:ac8:1625:: with SMTP id p34mr1046265qtj.95.1550075167698; Wed, 13 Feb 2019 08:26:07 -0800 (PST) MIME-Version: 1.0 References: <1549995065-27597-1-git-send-email-xiaoxiang@xiaomi.com> <20190212144606.4b7cf0f8@gandalf.local.home> <20190213084741.5512307a@gandalf.local.home> <20190213093154.7af84743@gandalf.local.home> In-Reply-To: <20190213093154.7af84743@gandalf.local.home> From: xiang xiao Date: Thu, 14 Feb 2019 00:25:56 +0800 Message-ID: Subject: Re: [PATCH] printk: add KERN_NOTIME to skip the timestamp To: Steven Rostedt Cc: Petr Mladek , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Xiang Xiao Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 13, 2019 at 10:31 PM Steven Rostedt wrote: > > On Wed, 13 Feb 2019 22:00:04 +0800 > xiang xiao wrote: > > > On Wed, Feb 13, 2019 at 9:47 PM Steven Rostedt wrote: > > > > > > On Wed, 13 Feb 2019 14:19:01 +0800 > > > xiang xiao wrote: > > > > > > > On Wed, Feb 13, 2019 at 3:46 AM Steven Rostedt wrote: > > > > > > > > > > On Wed, 13 Feb 2019 02:11:05 +0800 > > > > > Xiang Xiao wrote: > > > > > > > > > > > Because log may already add the timestamp sometime > > > > > > > > > > Can you be a bit more detailed on this. When and where does this > > > > > happen? > > > > > > > > Here is my case: > > > > 1.A small MCU(Cortex M4) in SoC run RTOS > > > > 2.RTOS append timestamp to log for the accurate timing > > > > 3.RTOS send log to Linux kernel when buffer exceed the threshold > > > > 4.Kernel call printk to dump the received buffer > > > > So I want that printk skip the timestamp here. > > > > > > > > > If anything, I would probably prefer that we export whether > > > > > time is being printed, and have the caller not print time if printk is > > > > > doing it already, than to add the complexity into printk itself. > > > > > > > > Actually, the timestamp of our initial implementation like your > > > > suggestion come from printk, > > > > but we found that timestamp from kernel isn't accurate as from RTOS > > > > due the buffer and IPC. > > > > > > > > > > If the timestamps are different, then you don't want to remove the > > > printk one. Otherwise you are going to have a confusion between your > > > added timestamp mixed in with the kernel's inaccurate timestamps. > > > > > > > Here is a sample output with this patch: > > [ 10.991426] virtio_rpmsg_bus virtio1: rpmsg host is online > > [ 10.991443] remoteproc remoteproc1: registered virtio1 (type 7) > > [ 10.991450] remoteproc remoteproc1: remote processor > > f9210000.toppwr:sen-rproc is now up > > [ 10.993715] virtio_rpmsg_bus virtio1: creating channel > > rpmsg-ttySENSOR addr 0x1 > > [ 10.994606] virtio_rpmsg_bus virtio1: creating channel rpmsg-ttyGPS addr 0x2 > > [ 10.995236] virtio_rpmsg_bus virtio1: creating channel rpmsg-clk addr 0x3 > > [ 10.995702] virtio_rpmsg_bus virtio1: creating channel rpmsg-syslog addr 0x4 > > [ 10.996197] virtio_rpmsg_bus virtio1: creating channel rpmsg-rtc addr 0x5 > > [ 10.997297] virtio_rpmsg_bus virtio1: creating channel rpmsg-hostfs addr 0x6 > > [ 10.999842] virtio_rpmsg_bus virtio1: creating channel rpmsg-usrsock addr 0x7 > > [ 0.007680] sensor: NuttX sensor 7.28 e3c2ecb Feb 12 2019 16:53:49 > > arm song/banks > > ^^^^^^^^^^^^^ > > [ 11.918177] random: crng init done > > [ 12.567362] e2fsck: e2fsck 1.42.9 (28-Dec-2013) > > > > Without this patch: > > [ 10.991426] virtio_rpmsg_bus virtio1: rpmsg host is online > > [ 10.991443] remoteproc remoteproc1: registered virtio1 (type 7) > > [ 10.991450] remoteproc remoteproc1: remote processor > > f9210000.toppwr:sen-rproc is now up > > [ 10.993715] virtio_rpmsg_bus virtio1: creating channel > > rpmsg-ttySENSOR addr 0x1 > > [ 10.994606] virtio_rpmsg_bus virtio1: creating channel rpmsg-ttyGPS addr 0x2 > > [ 10.995236] virtio_rpmsg_bus virtio1: creating channel rpmsg-clk addr 0x3 > > [ 10.995702] virtio_rpmsg_bus virtio1: creating channel rpmsg-syslog addr 0x4 > > [ 10.996197] virtio_rpmsg_bus virtio1: creating channel rpmsg-rtc addr 0x5 > > [ 10.997297] virtio_rpmsg_bus virtio1: creating channel rpmsg-hostfs addr 0x6 > > [ 10.999842] virtio_rpmsg_bus virtio1: creating channel rpmsg-usrsock addr 0x7 > > [ 11.105345][ 0.007680] sensor: NuttX sensor 7.28 e3c2ecb Feb 12 > > 2019 16:53:49 arm song/banks > > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > > [ 11.918177] random: crng init done > > [ 12.567362] e2fsck: e2fsck 1.42.9 (28-Dec-2013) > > > > Which one do you think better? > > Honestly, the one without the patch. > > Seriously, it also makes it easy to see where that message happened > with respect to the other printks. With your patch, we would have no > idea, and if I was a normal user, unaware of this patch, I would > probably submit a bug report claiming that something is wrong with the > timestamps. > Ok, I will remove KERN_NOTIME from rpmsg-syslog driver. > -- Steve