Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1986347pxa; Mon, 24 Aug 2020 01:30:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj7a4hURU9ROCXk6dW8ZXkj8nJ4P9FIY5jHzjkYATwL7V58tdB/kZVu95/jK9EdmPFYW4W X-Received: by 2002:a50:82c7:: with SMTP id 65mr4465915edg.138.1598257807424; Mon, 24 Aug 2020 01:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598257807; cv=none; d=google.com; s=arc-20160816; b=VKmmH5Joicj03Zz9ooYGzBi6kw26qkY/djLw/FjsL1IbgPFJJEtiSlRukfJVdlyWaT uHbZjhsjVGERa5h8+2ViY7Vk4c/QXwlEY38fpRLi7gLWEwMYaHw5iFeZs8wgVNpLEKtJ Ttj2kOEl0eJTGDhCzR6eUOiYsxlE31V5Tfs/AJoP9l5AkWhmalJ4xG/4DEd9b4O4j26b 4PANGOePVwBvud+Fa/ZWOwPvaZuVgil+1n39ESGL/jnbbYZx9pkzehCYfZ6oG6JKSz/4 C5QoejH0IA8RFQLHziNYBAdvI0SqV7eog27uOLexEoCzm2nitcrq1XI4UMiEKAjdPgpE bmGA== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=VfcVIZXzAB1A9DnLbRv77FNKG+g7ceAAkXfiVEi6R3M=; b=H943gkaD+fBct4U23wh2PE5ItXSxZAw7WMQFIYQZrrgrfWpRXY4AEcREcmAX4WRmXI XkVPeFDQb3gtlIEMAIr8U0TrWDQBzQju9fx6tuBWsfmlgoxxYbZRUCd1D72zBhEPOHyj jnmw7PdDpfHXXwsFU544zIaKfGUNaB2uqEMznxnmbJ6kRPp1+O2maUvlQqvrS8GOvo/g 2NYiTncYp5uSo/nPdGV4HjnUEJafdOCnNr3vC5PWxIa/MIP37upCI963IheKi9wZW1Pu S5Ov8u1pWaZ9oUeGZXg6vXLeITfnBg//XJKYLnlT4hdB5RM+CppuCol8wYx/HzFL7xGo 8eeg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si718878edq.396.2020.08.24.01.29.44; Mon, 24 Aug 2020 01:30:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbgHXI0U convert rfc822-to-8bit (ORCPT + 99 others); Mon, 24 Aug 2020 04:26:20 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:47931 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbgHXI0U (ORCPT ); Mon, 24 Aug 2020 04:26:20 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-280-YmP3yX5pPw6c5HnJR1Czfw-1; Mon, 24 Aug 2020 09:26:14 +0100 X-MC-Unique: YmP3yX5pPw6c5HnJR1Czfw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 24 Aug 2020 09:26:13 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 24 Aug 2020 09:26:13 +0100 From: David Laight To: 'Nicolas Boichat' , Steven Rostedt 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 Thread-Topic: [PATCH v5] kernel/trace: Add DISALLOW_TRACE_PRINTK make option Thread-Index: AQHWecKchjFb7pHUGUqNEDurUkt7jKlG664w Date: Mon, 24 Aug 2020 08:26:13 +0000 Message-ID: <3f84781f12424cbfa552981af42dfaf2@AcuMS.aculab.com> References: <20200824105852.v5.1.I4feb11d34ce7a0dd5ee2c3327fb5a1a9a646be30@changeid> In-Reply-To: <20200824105852.v5.1.I4feb11d34ce7a0dd5ee2c3327fb5a1a9a646be30@changeid> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Boichat > Sent: 24 August 2020 03:59 > > trace_printk is meant as a debugging tool, and should not be > compiled into production code without specific debug Kconfig > options enabled, or source code changes, as indicated by the > warning that shows up on boot if any trace_printk is called: > ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ** > ** ** > ** trace_printk() being used. Allocating extra memory. ** > ** ** > ** This means that this is a DEBUG kernel and it is ** > ** unsafe for production use. ** > > If DISALLOW_TRACE_PRINTK=1 is passed on the make command > line, the kernel will generate a build-time error if > trace_printk is used. We expect distributors to set this > option for their production kernels. > > Note that the code to handle trace_printk is still present, > so this does not prevent people from compiling out-of-tree > kernel modules, or BPF programs. > > Also, we are not making this a kernel config option as we > want the developer convenience of being able to reuse a > production kernel config, add trace_printk for debugging, > and rebuild, without any config changes. Since the objective seems to be to ensure there are no calls to trace_printk() in the git tree, but to allow them in uncommitted sources. Why not use a config option and rely on rand-config builds to detect any 'accidental' commits? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)