Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp214289imj; Wed, 13 Feb 2019 07:11:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IaM9c6b2recD+OHWc4NWrJvsbQe3lHnJPp7crCWWbBfej/lgGFwm6sAD4jfQixqLRjl5flB X-Received: by 2002:a17:902:7592:: with SMTP id j18mr944690pll.289.1550070660653; Wed, 13 Feb 2019 07:11:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550070660; cv=none; d=google.com; s=arc-20160816; b=YYNFiKtBm0xvZ9qldi4wPZ9725UfbffyTkydJtGU2ROIgIV8VBPjTLCbkYoGzvphgC JqFzGA1pBYbLgd1I9TLaiGxkT4ry1xj87HedU/49rjgxHpb/xrloNPIE9XhLmUvEl+NI C8r3L3d3FhqZzPnCiU2Hq7RQUnJAxfza+4as3o8KaUV/X5ricGTd3Ta4QTdqC2+xy/Qe XPyIjcbhrplC4bw4fN3nRBEINrUsXXKQdnDmkGCfiIYYB41vNgxz2eXjfYwN3Z4vxCI1 vyLSAgpInL4z6ikGBXIJV6lm71t1LQ+f0Sr8GaWBR84BV0X6d22iaIg/Vpsas8rye1pB GTbw== 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=mYbCWBQ0Y9GWex24vzz5nL8T5g6xF4FMzPuyoRoFGm4=; b=PYmRpHtavusAffHR9uVH/nWtIOX0uhYBG3WJZmYqNI5VgZglQ4weLjTqxUwnj89H+N Dn9CyvTm/P/7iAWbqo0+1QEqw1JJEoyMNd1HPMJwL7kFGetgIWc7CtRkVPWPr/oXsrjI Le5L2IVl9Rr47/vzyvzy0mmQfY7uHCly+5P+mkpyTJMuFXGtXorXqMSfhY/C1D/Z94ki a2EFjs/QkHW8/poDFwsunhEA5IvOuUNItHVRQI72zSS96kd9ggRMXKh6Qp6OCmb3v685 ZFeS8iygKqWWbBTnNY/HUvENsyzMBjqaQkh5WK32FCAvBX/xwU+ZwcjVqSCt9VgV+BxB 4pAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gO2qUv2j; 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 i20si3573996pfo.100.2019.02.13.07.10.43; Wed, 13 Feb 2019 07:11:00 -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=gO2qUv2j; 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 S2390362AbfBMOA0 (ORCPT + 99 others); Wed, 13 Feb 2019 09:00:26 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:45521 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728615AbfBMOAZ (ORCPT ); Wed, 13 Feb 2019 09:00:25 -0500 Received: by mail-qt1-f193.google.com with SMTP id e5so2565845qtr.12 for ; Wed, 13 Feb 2019 06:00:24 -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=mYbCWBQ0Y9GWex24vzz5nL8T5g6xF4FMzPuyoRoFGm4=; b=gO2qUv2jZwtHceCBFPeMhKMpEfxaOZqwURhBXpcZlaeGe13MhG6UWFkg/gvKxXEBwm JvE4ZF6041L4Op5jDYiPFR8y8gWlLbyFpirVyTA9c8Gv3i6SfEddjebeCGOpirkj3+yI l+KD2AoBjwfzrBQHtuLToRsZC2UpG833ssoDl9/0qARcyks7rJzx3zWT10YpzaFArDAi uA3uaVawxAIq4EbDqSwbTm0gTPkTrh1e3+kqZl1i5AgnVU56ilS+3spt7kaqz+w1cqcL DvXeF92JzYFWSutKgwVhk1nfP6R/Os1XboCsK8QkI3shRdRkebtgpXTwJcim/W1u7CEM n8KQ== 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=mYbCWBQ0Y9GWex24vzz5nL8T5g6xF4FMzPuyoRoFGm4=; b=Cf6NEsCAciE99hdZ/qX7311uO+rjDHHRV33a7BJCkW4PHSBEN/LRvM5+F8Mrz4NReK aCfchR9CPiF7e15WrMIRztkKWNFbU+RewEKm/KESBaRAhvJqDsY6PXc/GM87r3tUYF8n MuFLB870j7fPXK61rYc9O2y0R3KtalVfkzrkHttXni8ypGw8Jq7jNdFYekFy62PXt6mC VgrJ/ihWx3eLROuVeHh5XePaLm4+B3gSD774f+mfEvKOXbTExpuSRONGME+xI3PcIXNk 4r9I8J57ghsa56IK3QTu5Tlyb8CmCQCNYEBC+jkQgZZw17YF3bCPYOTTWj2XF9f3Sxng 7GGw== X-Gm-Message-State: AHQUAuac4/QOZXKwUwn+kXKWePucOihozJ48TZ4x4AOXRlMWbgZM53J9 bD2ruYFcHioUpuxGyjDAXYSXcj2PICD+ujuv0cM= X-Received: by 2002:a0c:8aa1:: with SMTP id 30mr479699qvv.1.1550066424479; Wed, 13 Feb 2019 06:00:24 -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> In-Reply-To: <20190213084741.5512307a@gandalf.local.home> From: xiang xiao Date: Wed, 13 Feb 2019 22:00:04 +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 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? > -- Steve