From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7221C433DF for ; Fri, 21 Aug 2020 03:05:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4907207DE for ; Fri, 21 Aug 2020 03:05:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727093AbgHUDFE (ORCPT ); Thu, 20 Aug 2020 23:05:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:37760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725852AbgHUDFD (ORCPT ); Thu, 20 Aug 2020 23:05:03 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2EDEF20732; Fri, 21 Aug 2020 03:05:01 +0000 (UTC) Date: Thu, 20 Aug 2020 23:04:59 -0400 From: Steven Rostedt To: Joe Perches Cc: Nicolas Boichat , Mauro Carvalho Chehab , Greg Kroah-Hartman , Andy Shevchenko , Sakari Ailus , devel@driverdev.osuosl.org, lkml , Linux Media Mailing List , Peter Zijlstra , Thomas Gleixner , Josh Poimboeuf , Douglas Anderson , Guenter Roeck Subject: Re: [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed Message-ID: <20200820230459.2471c892@oasis.local.home> In-Reply-To: References: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> <20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid> <20200820102347.15d2f610@oasis.local.home> <20200820203601.4f70bf98@oasis.local.home> <20200820215701.667f02b2@oasis.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Aug 2020 19:49:59 -0700 Joe Perches wrote: > Perhaps make trace_printk dependent on #define DEBUG? This is basically what Nicolas's patch series does in this very patch! And no, I hate it. We are currently discussing ways of not having to modify the config in order to allow trace_printk() to be used. We don't want to burden the developer to take a config, add a bunch of trace_printks() and find that it's compiled out! Thus, this is a NAK. -- Steve > > Something like: > --- > include/linux/kernel.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index 500def620d8f..6ca8f958df73 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -717,6 +717,7 @@ do { \ > * let gcc optimize the rest. > */ > > +#ifdef DEBUG > #define trace_printk(fmt, ...) \ > do { \ > char _______STR[] = __stringify((__VA_ARGS__)); \ > @@ -725,6 +726,12 @@ do { \ > else \ > trace_puts(fmt); \ > } while (0) > +#else > +#define trace_printk(fmt, ...) \ > +do { \ > + __trace_printk_check_format(fmt, ##args); \ > +} while (0) > +#endif > > #define do_trace_printk(fmt, args...) \ > do { \ > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49E52C433E1 for ; Fri, 21 Aug 2020 03:05:07 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2023B20732 for ; Fri, 21 Aug 2020 03:05:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2023B20732 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CED65886B5; Fri, 21 Aug 2020 03:05:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WHc9-Xzf77SS; Fri, 21 Aug 2020 03:05:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 4D9BB8867E; Fri, 21 Aug 2020 03:05:05 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 39ED51BF34B for ; Fri, 21 Aug 2020 03:05:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2BEAB22E6E for ; Fri, 21 Aug 2020 03:05:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o4d1-tLkGggd for ; Fri, 21 Aug 2020 03:05:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by silver.osuosl.org (Postfix) with ESMTPS id 97F0222D0D for ; Fri, 21 Aug 2020 03:05:02 +0000 (UTC) Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2EDEF20732; Fri, 21 Aug 2020 03:05:01 +0000 (UTC) Date: Thu, 20 Aug 2020 23:04:59 -0400 From: Steven Rostedt To: Joe Perches Subject: Re: [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed Message-ID: <20200820230459.2471c892@oasis.local.home> In-Reply-To: References: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> <20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid> <20200820102347.15d2f610@oasis.local.home> <20200820203601.4f70bf98@oasis.local.home> <20200820215701.667f02b2@oasis.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Nicolas Boichat , Peter Zijlstra , Greg Kroah-Hartman , lkml , Andy Shevchenko , Douglas Anderson , Sakari Ailus , Josh Poimboeuf , Guenter Roeck , Thomas Gleixner , Mauro Carvalho Chehab , Linux Media Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Thu, 20 Aug 2020 19:49:59 -0700 Joe Perches wrote: > Perhaps make trace_printk dependent on #define DEBUG? This is basically what Nicolas's patch series does in this very patch! And no, I hate it. We are currently discussing ways of not having to modify the config in order to allow trace_printk() to be used. We don't want to burden the developer to take a config, add a bunch of trace_printks() and find that it's compiled out! Thus, this is a NAK. -- Steve > > Something like: > --- > include/linux/kernel.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index 500def620d8f..6ca8f958df73 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -717,6 +717,7 @@ do { \ > * let gcc optimize the rest. > */ > > +#ifdef DEBUG > #define trace_printk(fmt, ...) \ > do { \ > char _______STR[] = __stringify((__VA_ARGS__)); \ > @@ -725,6 +726,12 @@ do { \ > else \ > trace_puts(fmt); \ > } while (0) > +#else > +#define trace_printk(fmt, ...) \ > +do { \ > + __trace_printk_check_format(fmt, ##args); \ > +} while (0) > +#endif > > #define do_trace_printk(fmt, args...) \ > do { \ > _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel