Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758602AbXI0VSS (ORCPT ); Thu, 27 Sep 2007 17:18:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756484AbXI0VSH (ORCPT ); Thu, 27 Sep 2007 17:18:07 -0400 Received: from rv-out-0910.google.com ([209.85.198.186]:60620 "EHLO rv-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755957AbXI0VSF (ORCPT ); Thu, 27 Sep 2007 17:18:05 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=NhgcUz0Ff3x7svYbWsYpTV0jGB+SL+XVUS3uLXZ8WnhEPVbMZMmF9F0lLi3mhVlxjfRlUs8CV4M69EeEKdYj/DIDEU9UI5/1uwug70oH7F9gmtCW+DKcGS4Rk41npqsZBqCRr7YBLSNoxS0GctXyOOGLkqkNvcgBKwgKM4ppcPM= Message-ID: <19f34abd0709271418l471cf7b9gf24161190772fac@mail.gmail.com> Date: Thu, 27 Sep 2007 23:18:04 +0200 From: "Vegard Nossum" To: LKML Subject: [RFC] New kernel-message logging API (take 2) Cc: "Kyle Moffett" , "Michael Holzheu" , "Joe Perches" , "Rob Landley" , "Dick Streefland" , "Geert Uytterhoeven" , "Jesse Barnes" , "Arnd Bergmann" , "Jan Engelhardt" , "Emil Medve" , "Stephen Hemminger" , "linux@horizon.com" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 12496 Lines: 317 Hello, A big thanks to everybody who read and replied to my first e-mail; I have tried my best to incorporate your feedback and suggestions. I also added some CCs who recently participated in logging-related discussions. Changes (since Sept. 22): * Extensibility -> Allowing the compiler to eliminate messages below a certain threshold requires changing the API. * Add some special-purpose logging functions (printk_detected(), _registered(), _settings(), and _copyright()) * Fine-grained log-level control. "Everything above" or "everything below" can be emulated by turning the specific log-levels on or off. * Define an extra header containing the (optional) secondary interface (err()/warn()/info()) * Remove kprint_*() aliases. * kprint_() is better than kprint( CONFIG_KPRINT_LOGLEVEL_MAX) { \ kprint_real_block_init(block, loglevel); #define kprint_block(block, fmt, ...) \ kprint_real_block(block, fmt, ## __VA_ARGS__); #define kprint_block_flush(block) \ kprint_real_block_flush(block); \ } /* Thus, this C code: */ kprint_block_init(&block, KPRINT_INFO); kprint_block(&block, "Hello world"); kprint_block_flush(&block); /* Would pre-process into this: */ if(6 < 4) { kprint_real_block_init(&block, 6); kprint_real_block(&block, "Hello world"); kprint_block_flush(&block); } } References [1] http://lkml.org/lkml/2007/9/21/267 (Joe Perches) [2] http://lkml.org/lkml/2007/9/20/352 (Rob Landley) [3] http://lkml.org/lkml/2007/9/21/151 (Dick Streefland) [4] http://lkml.org/lkml/2007/6/13/146 (Michael Holzheu) [5] http://lkml.org/lkml/2007/9/24/320 (Jesse Barnes) [6] http://lkml.org/lkml/2007/9/22/162 (Miguel Ojeda) [7] http://lkml.org/lkml/2007/9/25/62 (Vegard Nossum) [8] http://lkml.org/lkml/2007/9/22/157 (Joe Perches) - 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/