From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17077C04EB9 for ; Mon, 3 Dec 2018 21:10:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BD6520850 for ; Mon, 3 Dec 2018 21:10:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BD6520850 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=i-love.sakura.ne.jp Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726019AbeLCVKv (ORCPT ); Mon, 3 Dec 2018 16:10:51 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:26364 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725952AbeLCVKu (ORCPT ); Mon, 3 Dec 2018 16:10:50 -0500 Received: from fsav304.sakura.ne.jp (fsav304.sakura.ne.jp [153.120.85.135]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id wB3LAmr2011442; Tue, 4 Dec 2018 06:10:48 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav304.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav304.sakura.ne.jp); Tue, 04 Dec 2018 06:10:48 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav304.sakura.ne.jp) Received: from [192.168.1.8] (softbank126126163036.bbtec.net [126.126.163.36]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id wB3LAgv0011428 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Tue, 4 Dec 2018 06:10:48 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] printk: Add caller information to printk() output. To: Petr Mladek Cc: Dmitry Vyukov , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Andrew Morton , LKML References: <1543045075-3008-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> <20181130154024.ls3mntfdr4zvluub@pathway.suse.cz> <20181203150603.cdqii263e4kmmibo@pathway.suse.cz> From: Tetsuo Handa Message-ID: Date: Tue, 4 Dec 2018 06:10:40 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: <20181203150603.cdqii263e4kmmibo@pathway.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/12/04 0:06, Petr Mladek wrote: >> If we modify print_time(), I think that the leading spaces inserted by "%5lu" >> makes little sense, for "%5lu" is too small for systems with uptime >= 1.16 days >> and parsers after all cannot assume fixed length for the timestamp field. Then, >> we could change from "%5lu.%06lu" to "%lu.%06lu" so that parsers (like /bin/awk) >> can get prefix part using white spaces as a delimiter. > > My primary concern was a human readability. The different header columns > are separated by brackets and the message itself is separated by the space. PID_MAX_LIMIT is 4194304, which can take up to 10 bytes if [T%u] is used. But unless a race occurs, each series of printk() lines are printed with same width. My concern is how to minimize number of characters written to consoles, for writing to consoles are slow, and userspace usually uses /dev/kmsg rather than netconsole as a source. For normal users who do not need to directly parse console/netconsole output, saving spaces in the header fields will be OK. > /dev/kmsg uses key=value notation. It does not need any version. The > version filed was intended for crashdump. It would make the life > easier for its maintainers. If the version field is for crashdump rather than for netconsole, we can get it from some vmcoreinfo variable rather than appending to every record.