From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751760AbdH2Qsv (ORCPT ); Tue, 29 Aug 2017 12:48:51 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:37502 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751250AbdH2Qst (ORCPT ); Tue, 29 Aug 2017 12:48:49 -0400 MIME-Version: 1.0 In-Reply-To: <20170828090521.GA25025@amd> References: <20170815025625.1977-1-sergey.senozhatsky@gmail.com> <20170828090521.GA25025@amd> From: Linus Torvalds Date: Tue, 29 Aug 2017 09:48:48 -0700 X-Google-Sender-Auth: ksS_uLp0TOwNXGxEqOucjKlM774 Message-ID: Subject: Re: printk: what is going on with additional newlines? To: Pavel Machek Cc: Sergey Senozhatsky , Petr Mladek , Steven Rostedt , Jan Kara , Andrew Morton , Jiri Slaby , Andreas Mohr , Tetsuo Handa , Linux Kernel Mailing List , Sergey Senozhatsky 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 Mon, Aug 28, 2017 at 2:05 AM, Pavel Machek wrote: > Hi! > > In 4.13-rc, printk("foo"); printk("bar"); seems to produce > foo\nbar. That's... quite surprising/unwelcome. What is going on > there? Are timestamps responsible? No. It's actively trying to treach you not to do shit. If you want to continue a line, you NEED to use KERN_CONT. That has always been true. It hasn't always been enforced, though. If you do two printk's and the second one doesn't say "I'm a continuation", the printk logic assumes you're just confused and wanted two lines. And no, we are *NOT* adding code to printk to help people avoid this. Quite the reverse. Stop doing continuations at all please. But if you do, you'd better use KERN_CONT. And if you don't, and you get multiple lines, it's your own damn fault. Linus