Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2144652pxa; Mon, 24 Aug 2020 06:31:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4xGiAfEwaZDSGuC0mdQ+eN+FSH755eXzGIFqbpyBF5P3SkClR0OsgVqdBTTzVbc7JtiSx X-Received: by 2002:aa7:ce90:: with SMTP id y16mr5494523edv.325.1598275903744; Mon, 24 Aug 2020 06:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598275903; cv=none; d=google.com; s=arc-20160816; b=OlnoKZvMcMlY8a85RfK5uGHpTRYqukDGAojxXrcAQkIHCsi7fngSoy3e5YVdiVOaVw 4T0kRt9qwRybtYKcH0ymxj8FUMQ9WoVKu2yO6eT2sB17jKAwK1mkYci3UIqtAAsAl5cS mYB7Xd2qUpeAMDcHBF7Xjhe+hnFeRAJSJphYZpjpqMm1o7WG/b7LTA8A7Se7GzaKpHON B91gx+5YpL9b+LC3GM3SCMDDwLMJcA2bjdVzYdAucMTpB4/I2YM3bQNCpQ+mu6CfdQ6a 1gTuxvHB9cbu8EW8C9DFYGlf+5igV8K2VeqcaAVaPvcpM13osw0iATOBaUnA6jS/La4l y3QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=iwVOPEU9OiCvMibMZAGg/Gef06q4T0Dj5+3wd3OygOo=; b=lrwt3SL6QNApWCQvc2LYqVV3Nay5jN6HXCmRKmMSWyXixZX5z9kwPhHEkWv9oUthI1 bw2VOIt1670Ah9znnQ90Lj/31HFyyLuSfwg7/LGM0HZfnI1wWFIPi0Xx6oKdYcf+oUcD oSQpDraybhvCbGa/za70ELCqEHKj8mv86kttsi1J5DrHPDj6x3iHK0iNx5qZiTvMthCQ gx0HXe2yZSk3ttk9k/ugq0XJMUp/IlRn2WUQTxLUpe+8ZQvA+CoddnEsnhtIfE6scBam Gx04TfuCDw89I8l7CopC+N3/RXv/y/G1AAa2TV54Jb7MCz5mSNHqK0pgPghqsIdFcUCj ArvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bq9si4807048ejb.224.2020.08.24.06.31.19; Mon, 24 Aug 2020 06:31:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgHXNa3 (ORCPT + 99 others); Mon, 24 Aug 2020 09:30:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:54752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgHXNaX (ORCPT ); Mon, 24 Aug 2020 09:30:23 -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 ACAAB206B5; Mon, 24 Aug 2020 13:30:21 +0000 (UTC) Date: Mon, 24 Aug 2020 09:30:20 -0400 From: Steven Rostedt To: Nicolas Boichat Cc: dianders@chromium.org, groeck@chromium.org, Andrew Morton , Andy Shevchenko , Daniel Vetter , "Guilherme G. Piccoli" , Kars Mulder , Kees Cook , Masahiro Yamada , Michal Marek , Thomas Gleixner , Tiezhu Yang , Will Deacon , Yue Hu , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5] kernel/trace: Add DISALLOW_TRACE_PRINTK make option Message-ID: <20200824093020.073ae8d8@oasis.local.home> In-Reply-To: <20200824105852.v5.1.I4feb11d34ce7a0dd5ee2c3327fb5a1a9a646be30@changeid> References: <20200824105852.v5.1.I4feb11d34ce7a0dd5ee2c3327fb5a1a9a646be30@changeid> 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 Mon, 24 Aug 2020 10:59:13 +0800 Nicolas Boichat wrote: > --- > > Changes since v4: > - Turns this into a make option, instead of a config > option, as suggested by Steven Rostedt . > > Changes since v2/v3: > - Rebase only, v3 didn't exist as I just split out the other > necessary patches. > - Added patch 3/3 to fix atomisp_compat_css20.c > > Changes since v1: > - Use static_assert instead of __static_assert (Jason Gunthorpe) > - Fix issues that can be detected by this patch (running some > randconfig in a loop, kernel test robot, or manual inspection), > by: > - Making some debug config options that use trace_printk depend > on the new config option. > - Adding 3 patches before this one. > > Makefile | 14 ++++++++++++++ > include/linux/kernel.h | 17 ++++++++++++++++- > 2 files changed, 30 insertions(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index c4470a4e131f2ce..fb8b0d7fb4b2df7 100644 > --- a/Makefile > +++ b/Makefile > @@ -100,6 +100,16 @@ endif > > export quiet Q KBUILD_VERBOSE > > +# Disallow use of trace_printk. Can be used by production kernels. > +ifeq ("$(origin DISALLOW_TRACE_PRINTK)", "command line") > + KBUILD_DISALLOW_TRACE_PRINTK = $(DISALLOW_TRACE_PRINTK) > +endif > +ifndef KBUILD_DISALLOW_TRACE_PRINTK > + KBUILD_DISALLOW_TRACE_PRINTK = 0 > +endif > + > +export KBUILD_DISALLOW_TRACE_PRINTK > + > # Kbuild will save output files in the current working directory. > # This does not need to match to the root of the kernel source tree. > # > @@ -838,6 +848,10 @@ KBUILD_AFLAGS += -gz=zlib > KBUILD_LDFLAGS += --compress-debug-sections=zlib > endif > > +ifeq ($(KBUILD_DISALLOW_TRACE_PRINTK),1) > +KBUILD_CFLAGS += -DDISALLOW_TRACE_PRINTK > +endif > + > KBUILD_CFLAGS += $(DEBUG_CFLAGS) > export DEBUG_CFLAGS > There's one more thing we need to do, is if you build without this option then build with it, you should trigger a full kernel rebuild. Otherwise, if you build without the option, then build with it, and it doesn't rebuild the tree, it wont catch anything. -- Steve