From patchwork Thu Aug 16 07:12:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi DOYU X-Patchwork-Id: 1329991 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C74DFDF280 for ; Thu, 16 Aug 2012 07:12:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755361Ab2HPHMl (ORCPT ); Thu, 16 Aug 2012 03:12:41 -0400 Received: from hqemgate04.nvidia.com ([216.228.121.35]:2464 "EHLO hqemgate04.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606Ab2HPHMl convert rfc822-to-8bit (ORCPT ); Thu, 16 Aug 2012 03:12:41 -0400 Received: from hqnvupgp06.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Thu, 16 Aug 2012 00:12:00 -0700 Received: from hqemhub03.nvidia.com ([172.17.108.22]) by hqnvupgp06.nvidia.com (PGP Universal service); Thu, 16 Aug 2012 00:12:40 -0700 X-PGP-Universal: processed; by hqnvupgp06.nvidia.com on Thu, 16 Aug 2012 00:12:40 -0700 Received: from deemhub01.nvidia.com (10.21.69.137) by hqemhub03.nvidia.com (172.20.150.15) with Microsoft SMTP Server (TLS) id 8.3.264.0; Thu, 16 Aug 2012 00:12:40 -0700 Received: from DEMAIL01.nvidia.com ([10.21.69.140]) by deemhub01.nvidia.com ([10.21.69.137]) with mapi; Thu, 16 Aug 2012 09:12:37 +0200 From: Hiroshi Doyu To: "crope@iki.fi" CC: "htl10@users.sourceforge.net" , "linux-media@vger.kernel.org" , "joe@perches.com" Date: Thu, 16 Aug 2012 09:12:28 +0200 Subject: Re: noisy dev_dbg_ratelimited() Thread-Topic: noisy dev_dbg_ratelimited() Thread-Index: Ac17foOkSPN3hKZdS32cicyTY7kwjA== Message-ID: <20120816.101228.1829061240257077271.hdoyu@nvidia.com> References: <1344991485.62541.YahooMailClassic@web29404.mail.ird.yahoo.com><502AF5E3.7080405@iki.fi><502C48DC.9090303@iki.fi> In-Reply-To: <502C48DC.9090303@iki.fi> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-nvconfidentiality: public acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Antti, Antti Palosaari wrote @ Thu, 16 Aug 2012 03:11:56 +0200: > Hello Hiroshi, > > I see you have added dev_dbg_ratelimited() recently, commit > 6ca045930338485a8cdef117e74372aa1678009d . > > However it seems to be noisy as expected similar behavior than normal > dev_dbg() without a ratelimit. > > I looked ratelimit.c and there is: > printk(KERN_WARNING "%s: %d callbacks suppressed\n", func, rs->missed); > > What it looks my eyes it will print those "callbacks suppressed" always > because KERN_WARNING. Right. Can the following fix the problem? From 905b1dedb6c64bc46a70f6d203ef98c23fccb107 Mon Sep 17 00:00:00 2001 From: Hiroshi Doyu Date: Thu, 16 Aug 2012 10:02:11 +0300 Subject: [PATCH 1/1] driver-core: Shut up dev_dbg_reatelimited() without DEBUG dev_dbg_reatelimited() without DEBUG printed "217078 callbacks suppressed". This shouldn't print anything without DEBUG. Signed-off-by: Hiroshi Doyu Reported-by: Antti Palosaari --- include/linux/device.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/include/linux/device.h b/include/linux/device.h index eb945e1..d4dc26e 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -962,9 +962,13 @@ do { \ dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) #define dev_info_ratelimited(dev, fmt, ...) \ dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) +#if defined(DEBUG) #define dev_dbg_ratelimited(dev, fmt, ...) \ dev_level_ratelimited(dev_dbg, dev, fmt, ##__VA_ARGS__) - +#else +#define dev_dbg_ratelimited(dev, fmt, ...) \ + no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#endif /* * Stupid hackaround for existing uses of non-printk uses dev_info *