Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762711AbZFOR5i (ORCPT ); Mon, 15 Jun 2009 13:57:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758562AbZFOR5b (ORCPT ); Mon, 15 Jun 2009 13:57:31 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:34048 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754116AbZFOR5a (ORCPT ); Mon, 15 Jun 2009 13:57:30 -0400 Date: Mon, 15 Jun 2009 10:57:15 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Arjan van de Ven cc: Linux Kernel Mailing List , Alan Cox Subject: Re: [PATCH] WARN(): add a \n to the message printk In-Reply-To: Message-ID: References: <20090615000822.6e6bf282@infradead.org> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2626 Lines: 83 On Mon, 15 Jun 2009, Linus Torvalds wrote: > > NOTE! This is, of course, totally untested. And we're bound to have > continuation printk's that don't have the KERN_CONT at front, and need > them added, but I think this is generally a saner model than what we have > now, or your suggested explicit addition of '\n'. Ok, it's tested now. It works, and yes, it does show cases of insanity: both missing KERN_CONT (common), and _extra_ KERN_CONT (odd). For example, the ACPI printk's seem to have pointless KERN_CONT's in them, an I get printouts like: [ 0.000000] ACPI: RSDP 00000000000fe020 00024 (v02 INTEL ) [ 0.000000] ACPI: XSDT 00000000bf7fe120 0006C (v01 INTEL DX58SO 0000084F 01000013) [ 0.000000] ACPI: FACP 00000000bf7fd000 000F4 (v03 INTEL DX58SO 0000084F MSFT 0100000D) ... where that "" is just because ACPI does something odd and pointless. The lack of KERN_CONT shows up in printouts like [ 26.626492] CPU: L1 I cache: 32K [ 26.626492] , L1 D cache: 32K ... [ 26.826201] ACPI: (supports S0 [ 26.826243] S5 [ 26.826326] ) ... [ 26.839617] ACPI: PCI Interrupt Link [LNKA] (IRQs [ 26.839660] 3 [ 26.839741] 4 [ 26.839823] 5 [ 26.839904] 6 [ 26.839985] 7 [ 26.840067] 9 [ 26.840148] 10 [ 26.840230] *11 [ 26.840313] 12 [ 26.840395] 14 [ 26.840476] 15 [ 26.840558] ) ... [ 26.964999] ACPI: CPU0 (power states: [ 26.965040] C1[C1] [ 26.965123] C2[C3] [ 26.965205] ) ... [ 27.231268] ata_piix 0000:00:1f.5: MAP [ [ 27.231309] P0 [ 27.231390] -- [ 27.231472] P1 [ 27.231553] -- [ 27.231635] ] ... [ 28.092534] sda: [ 28.092820] sda1 [ 28.092910] sda2 ... where the kernel now added a newline because they were separate printk's and didn't have KERN_CONT on the continuation. But despite seeing these kinds of things, I do think the patch is the right thing to do. It just shows that since KERN_CONT didn't use to _do_ anything, people obviously mis-used it. It's the old "if it wasn't tested, it's buggy" thing, but none of these look in the least like serious problems to the approach. Comments? We could make it remove the unnecessary '' things (so that you can always add KERN_CONT if you _want_ to), but the patch as-is will show them because I think it's useful to see them. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/