Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8376702imu; Tue, 4 Dec 2018 07:28:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/UmbRBKV4zHM5vEEk7edz7KqWZLcMQs4QnH/d7ZYybvXspDw/rC2upGvN9cCh4jOjN57eEt X-Received: by 2002:a17:902:b48b:: with SMTP id y11mr19677585plr.200.1543937308086; Tue, 04 Dec 2018 07:28:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543937308; cv=none; d=google.com; s=arc-20160816; b=dTl6qY4TisWdUAB/qOxwbEb3tcM7u1J8AgxQZFxZWZGkq0w8X33C2A9RioKZSXk5DB LRARQ5CE0zk7cXGtqyl1Ppuq4nEkF75X3X4XuanTVOxf0qRq0QVY9KLZrmyT9SZKmzm2 aAmpJRlqaD4MNc6XGVJjFxvx8aiKX3RhCwfeXy3EmYhmPPKXD/xzkmDvWOzGzNoN+ppA yM3l+meFjTql+Xid1aW3GMcsAPEZIJHQo60StVo70djsolDQLA4OgnmESU7zAHhQofWI kt6VvMgClgL3VAGSAfAiuRCHoTnSN5BnSPZKJpR2HVKeWTY0M86bgJz+U7SYvlPUiyT2 bSPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4NXiYyarZexqgolul8etliraRY4MIoKXpVBIxXaYNxE=; b=NBmRWa0TGhteIm8Wokz+CzL1qhcUQgPDuXKvpZUTIutz2nvKXANt2vCgdjVBQ3cBxT V2KdIO7q1LBK7EQfUBoTpaPuXFh75fRlV1zK5gPUoBe+0XKDwePNtD/pQBy7r8apKLOC ilzFM2N+4dBq770QDds1HkLtT1V/RfZMLKoKOlof2LF08gCuwQR+jF+Vv/Wqoy9kDENf NUbxx9U2XWaOBQQaaiuGhw9e8pgzv0X5J0YeKpW8HRhtvjmSySrzE704450FFRLr22oc MvWZBIIdSgOAtS5cFfvxNOM5XLfHPL7hx/ZNnLcapz871ak8GlF33qZm2MumTx1ZhN4R 5H9A== 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 r18si15718998pls.115.2018.12.04.07.28.12; Tue, 04 Dec 2018 07:28:28 -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; 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 S1726459AbeLDP13 (ORCPT + 99 others); Tue, 4 Dec 2018 10:27:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:33970 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725910AbeLDP13 (ORCPT ); Tue, 4 Dec 2018 10:27:29 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 81066AD25; Tue, 4 Dec 2018 15:27:26 +0000 (UTC) Date: Tue, 4 Dec 2018 16:27:24 +0100 From: Petr Mladek To: Tetsuo Handa Cc: Dmitry Vyukov , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Andrew Morton , LKML Subject: Re: [PATCH] printk: Add caller information to printk() output. Message-ID: <20181204152724.ypk44mi4a56nrud4@pathway.suse.cz> References: <1543045075-3008-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> <20181130154024.ls3mntfdr4zvluub@pathway.suse.cz> <20181203150603.cdqii263e4kmmibo@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2018-12-04 06:10:40, Tetsuo Handa wrote: > 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. 4194304 is the worst case. I would use the same approach as with the timestamp seconds. It uses 5 characters as the minimum. But it might eventully get bigger. IMHO, [T%5u] looks like a reasonable default. > But unless a race occurs, each series of printk() lines are printed with > same width. It is not about series of printk() lines. It is about readability of the entire log. > 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. The number of characters is important. But we do not need to get to the extreme. Readability by humans is important. > > /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. Exactly. And I asked you to add back VMCOREINFO_OFFSET(printk_log, from_id). Best Regards, Petr