From patchwork Mon Oct 1 13:09:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: poma X-Patchwork-Id: 1531401 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 42A6BDFFAD for ; Mon, 1 Oct 2012 13:09:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753055Ab2JANJi (ORCPT ); Mon, 1 Oct 2012 09:09:38 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:55666 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753033Ab2JANJh (ORCPT ); Mon, 1 Oct 2012 09:09:37 -0400 Received: by bkcjk13 with SMTP id jk13so4926278bkc.19 for ; Mon, 01 Oct 2012 06:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=El+DhVRugDV9Y6XOCdryAyAu4/9M6mAbUCzxdkzZ6R4=; b=WJLAIhJCNamm2ns1pBxdhfDBz+5h7nMQKYHyjDay1uWyLZbupQCMKHcJbcbaCjBm17 5rR30v43yqrPoyuz/lmVmZ7etu/IomG40/fcLbJ/VeDyPW028qosjIDoKtrOlgFmv1Yu g49ZubJfPuReEmpUkQ9Y9bTrF4Xpshdboj0KRBk7yrMR8F2h5Yfh8iMncWpv/0JHqgda EXo7B0OR1r+Fqa5IvtcDkZeBvecru5vcQQFtuQJtk/cKv9Q05R0IDU2Qs/olCVKEJa4B jPl+KCQE8DG+OKEylp0AlRcrE4CnWZksZOZoeXFYPz0bOt2/IZzOyqbvGUE+RpBdu0YQ 84gw== Received: by 10.204.9.3 with SMTP id j3mr6119036bkj.15.1349096976359; Mon, 01 Oct 2012 06:09:36 -0700 (PDT) Received: from nuna.dma (iskon7263.duo.carnet.hr. [31.147.124.95]) by mx.google.com with ESMTPS id w9sm8559243bkv.3.2012.10.01.06.09.34 (version=SSLv3 cipher=OTHER); Mon, 01 Oct 2012 06:09:35 -0700 (PDT) Message-ID: <5069960C.8020507@gmail.com> Date: Mon, 01 Oct 2012 15:09:32 +0200 From: poma User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Hiroshi Doyu CC: "linux-media@vger.kernel.org" , jwboyer@fedora, devel@lists.fedoraproject.org, kernel@lists.fedoraproject.org Subject: Re: [v3 1/1] driver-core: Shut up dev_dbg_reatelimited() without DEBUG References: <20120904.074040.1817050383890381031.hdoyu@nvidia.com> In-Reply-To: <20120904.074040.1817050383890381031.hdoyu@nvidia.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On 09/04/2012 06:40 AM, Hiroshi Doyu wrote: > dev_dbg_reatelimited() without DEBUG printed "217078 callbacks > suppressed". This shouldn't print anything without DEBUG. > > With CONFIG_DYNAMIC_DEBUG, the print should be configured as expected. > > Signed-off-by: Hiroshi Doyu > Reported-by: Hin-Tak Leung > Tested-by: Antti Palosaari > Tested-by: Hin-Tak Leung > Acked-by: Hin-Tak Leung > --- > include/linux/device.h | 62 +++++++++++++++++++++++++++++------------------ > 1 files changed, 38 insertions(+), 24 deletions(-) > > diff --git a/include/linux/device.h b/include/linux/device.h > index 9648331..bb6ffcb 100644 > --- a/include/linux/device.h > +++ b/include/linux/device.h > @@ -932,6 +932,32 @@ int _dev_info(const struct device *dev, const char *fmt, ...) > > #endif > > +/* > + * Stupid hackaround for existing uses of non-printk uses dev_info > + * > + * Note that the definition of dev_info below is actually _dev_info > + * and a macro is used to avoid redefining dev_info > + */ > + > +#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) > + > +#if defined(CONFIG_DYNAMIC_DEBUG) > +#define dev_dbg(dev, format, ...) \ > +do { \ > + dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ > +} while (0) > +#elif defined(DEBUG) > +#define dev_dbg(dev, format, arg...) \ > + dev_printk(KERN_DEBUG, dev, format, ##arg) > +#else > +#define dev_dbg(dev, format, arg...) \ > +({ \ > + if (0) \ > + dev_printk(KERN_DEBUG, dev, format, ##arg); \ > + 0; \ > +}) > +#endif > + > #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ > do { \ > static DEFINE_RATELIMIT_STATE(_rs, \ > @@ -955,33 +981,21 @@ 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(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) > #define dev_dbg_ratelimited(dev, fmt, ...) \ > - dev_level_ratelimited(dev_dbg, dev, fmt, ##__VA_ARGS__) > - > -/* > - * Stupid hackaround for existing uses of non-printk uses dev_info > - * > - * Note that the definition of dev_info below is actually _dev_info > - * and a macro is used to avoid redefining dev_info > - */ > - > -#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) > - > -#if defined(CONFIG_DYNAMIC_DEBUG) > -#define dev_dbg(dev, format, ...) \ > -do { \ > - dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ > +do { \ > + static DEFINE_RATELIMIT_STATE(_rs, \ > + DEFAULT_RATELIMIT_INTERVAL, \ > + DEFAULT_RATELIMIT_BURST); \ > + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ > + if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ > + __ratelimit(&_rs)) \ > + __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ > + ##__VA_ARGS__); \ > } while (0) > -#elif defined(DEBUG) > -#define dev_dbg(dev, format, arg...) \ > - dev_printk(KERN_DEBUG, dev, format, ##arg) > #else > -#define dev_dbg(dev, format, arg...) \ > -({ \ > - if (0) \ > - dev_printk(KERN_DEBUG, dev, format, ##arg); \ > - 0; \ > -}) > +#define dev_dbg_ratelimited(dev, fmt, ...) \ > + no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) > #endif > > #ifdef VERBOSE_DEBUG > http://patchwork.linuxtv.org/patch/14158/ Koji have the old one. Please do patch whit this one from Hiroshi, so we can use it with latest&greatest media_build without 'usb_urb_complete' flood. In an attach is Beefy Miracle aligned diff. Muchas gracias, poma --- v3-1-1-driver-core-Shut-up-dev_dbg_reatelimited-without-DEBUG.patch 2012-10-01 12:21:59.743710145 +0200 +++ device.h-3.5.4-2.fc17.x86_64.patch 2012-10-01 14:29:52.875520419 +0200 @@ -1,8 +1,6 @@ -diff --git a/include/linux/device.h b/include/linux/device.h -index 9648331..bb6ffcb 100644 ---- a/include/linux/device.h -+++ b/include/linux/device.h -@@ -932,6 +932,32 @@ int _dev_info(const struct device *dev, const char *fmt, ...) +--- /usr/src/kernels/3.5.4-2.fc17.x86_64/include/linux/device.h.orig 2012-10-01 14:28:24.609693878 +0200 ++++ /usr/src/kernels/3.5.4-2.fc17.x86_64/include/linux/device.h 2012-10-01 14:29:50.725647318 +0200 +@@ -939,6 +939,32 @@ #endif @@ -35,7 +33,7 @@ #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ do { \ static DEFINE_RATELIMIT_STATE(_rs, \ -@@ -955,33 +981,21 @@ do { \ +@@ -962,33 +988,21 @@ dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) #define dev_info_ratelimited(dev, fmt, ...) \ dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)