On Tue, 2014-01-28 at 00:26 +0000, Luck, Tony wrote: > > But that actually argues *more* for moving to a world where that > > (common, but also often-forgotten) final '\n' at the end should be > > de-emphasized. So I don't think it would be at all wrong to expect > > that > > > > printk("Line A"); > > printk("Line B"); > > > > should print two lines. We very much had that KERN_CONT to encode the > > *exception* to this, for the (not very common) cases where we end up > > listing multiple things on one line. Depends on how old the code in question is. KERN_CONT was introduced in Oct 2007 (commit 4749252776) and everything older than that actually did have the intention of continuing a previous line or was a defect. KERN_DEFAULT was June 2009 (commit e28d7137041) and that allowed printks to start with any KERN_<LEVEL> but KERN_CONT and actually start on a new line too even if the preceding printk did not end in '\n'. There are very few uses overall of KERN_DEFAULT. I think KERN_DEFAULT should be removed actually. All the uses might be better with a specific level. > Of course if people *really* want things on the same line, they usually end > up using sprintf() to save the individual pieces to some buffer and the dump > that out using one printk() call No, actually, they don't. There's probably much more code that uses KERN_CONT or no KERN_ level where it's intended that the printks be merged than uses of intermediate buffers. There are many uses of %pV that effectively serve as a mechanism to avoid using multiple printks though. > ... because KERN_CONT isn't much help when > some other code comes along and drops its own output in the middle of > what you were trying to pretty print. Exactly true. I've submitted quite a few patches that avoid multiple printks by either using %pV or coalescing the separate printks into a single printk. There are _lots_ more that could be done. Maybe adding a patch similar to what Linus proposes would cause a lot more of these changes to be done quicker. -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html