From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754558AbdIFCgs (ORCPT ); Tue, 5 Sep 2017 22:36:48 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:33189 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752064AbdIFCgr (ORCPT ); Tue, 5 Sep 2017 22:36:47 -0400 X-Google-Smtp-Source: ADKCNb6PFOD2FUcrdbGeihsNWd0tq+lnaL9jviaYZ6qNrhJCy9LlGmI5Ksgv2KDOz+uecswwHr7cdbh3lRoQs+mVGqU= MIME-Version: 1.0 In-Reply-To: <20170905105454.29160c5e@gandalf.local.home> References: <20170828124634.GD492@amd> <20170829134048.GA437@jagdpanzerIV.localdomain> <20170829195013.5048dc42@gandalf.local.home> <20170830010348.GB654@jagdpanzerIV.localdomain> <20170829211046.74644c8a@gandalf.local.home> <20170901131656.GA468@tigerII.localdomain> <1504287133.2361.11.camel@perches.com> <20170904052246.GB28534@jagdpanzerIV.localdomain> <20170905105454.29160c5e@gandalf.local.home> From: Linus Torvalds Date: Tue, 5 Sep 2017 19:36:46 -0700 X-Google-Sender-Auth: kOedUx1UqQUFvktG_YhODBzOAxU Message-ID: Subject: Re: printk: what is going on with additional newlines? To: Steven Rostedt Cc: Sergey Senozhatsky , Joe Perches , Sergey Senozhatsky , Pavel Machek , Petr Mladek , Jan Kara , Andrew Morton , Jiri Slaby , Andreas Mohr , Tetsuo Handa , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 5, 2017 at 7:54 AM, Steven Rostedt wrote: > You can do what I did with trace_printk(). I have a buffer per context. > Then you only need to use preempt_disable() to do the print. That is, > trace_printk() has 4 buffers: > > 1. Normal context > 2. softirq context > 3. irq context > 4. NMI context This is exactly what Tetsuo's code did (except he also added the current thread context), and I already told people once in this thread why that doesn't work. It may be fine if you want to do CPU tracing, but it's not acceptable for the whole line buffering. If I'm printing out bytes of a hex buffer, and I have a bug, and take a page fault, the context above doesn't change. But I sure as #%!Ing hell don't want the page fault information buffered with my hex bytes. They share no context at all. So no. Stop this idiotic "implicit context". Get that disease off your brain. It's wrong. Either you guys are happy with the current line buffering, or you do it with an explicit buffer context. No ifs, buts or idiotic context markers. Linus