Received: by 10.192.165.148 with SMTP id m20csp5026235imm; Tue, 24 Apr 2018 12:21:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/JAx+KLngUt4gtsPNggMIsuq4PX4oHNNKR7akir3Q4smHzKxJPsQ6YtQm8b/fN85omuB9Q X-Received: by 10.99.109.138 with SMTP id i132mr21627775pgc.314.1524597700549; Tue, 24 Apr 2018 12:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524597700; cv=none; d=google.com; s=arc-20160816; b=N2fUE01qopXS9eUFaFCkcsAksQPHfJmw/XVbWmKyQlhrxy63sDQd4XOcFJ+olg51AR Kjpv8CFC5WlaKFurXyQE8N2yAO+1wGA8brdEUWJ6xiIWopmLhSRL+Z+x+qvPadBiGuR3 yQU3Zmzhb14MKdmqZcBd181FgKJc7+lL/khA1uQIiHIkAMiZZzZiQVu8r2AjVLByD1TX coD3zszq94KSbknEh0nJvoDwOpFT52AI1Zk+1msNpGIOuFGHPLPhIi1wg8TXayaT5nUg 0sQmMaz+pnIAPADHcAsSz/A965PHL41TeA3x9drM6hAu3W2OyIZaCSSiUChtNFU1phHD s9OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=z8awwIQ/WbSUlJFVYf43ZMZIKtrHU+TPDPvaQ/nqPIE=; b=tRbyCwFouEG4/TSdv2ymB95utEuM87udKURKXIg6Gx4VuE91+4ODCRSu4+DZ/+X1jF YSUIoc+NLVgYClW9f9w9/u/OmXfuUdo79bGJJ9x3vKvZGkH1IK63CHv+UA2K7XYJDnV1 ny54iB660PAgK5ZZw8pRB8a/PNd/zKU5BQ2qZKficSHWbdRrmqXQbw+YISj0jTkxukWa C4YgSzVpdisUKTSj6fnZVJuC1jFpYbnM1iMp92tVaeUTKLfmdI5lHgIvHyOvrXCi/F1q qvQ75O8k1t4zFFaPVT6fMR35sdiIlzJeDExtqtkvKQWhTb3G0ZG10tAm3HJP587P180z gxZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=D791feuw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si10489474pfd.193.2018.04.24.12.21.25; Tue, 24 Apr 2018 12:21:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=D791feuw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751236AbeDXTUQ (ORCPT + 99 others); Tue, 24 Apr 2018 15:20:16 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:53426 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735AbeDXTUP (ORCPT ); Tue, 24 Apr 2018 15:20:15 -0400 Received: by mail-wm0-f68.google.com with SMTP id 66so3166837wmd.3 for ; Tue, 24 Apr 2018 12:20:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z8awwIQ/WbSUlJFVYf43ZMZIKtrHU+TPDPvaQ/nqPIE=; b=D791feuwGjutwzXVCxopThgOmdUE74WxEj59cWiR9deolz8gdlLe7deexBf32AJo3T lX96EGPn4ZUClIABjX5R3StnKteGAqK+xbvnM5WpePm4y/AWMaImKghk8iYdRf0R23Lz 7u7OP2D35LuKdZq712pdDdIUYXXXZBrV0bJV0VFDmOZNFJmQV7JSg18ZUx3ZZcayNLSR VmARrVloJIQyhhWZ3wzEXGr4cVpRKA2j4e+ugmlmAQrXQy5z3809wLXfs9MdpX4wpp+T QJQrVR3ofhGbh7CrlMve2X8zO0NMkO6RpTYfk4AEjzpMW7JYUGizJmq11REynCfqu/LX x8cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z8awwIQ/WbSUlJFVYf43ZMZIKtrHU+TPDPvaQ/nqPIE=; b=fhShE2/UtGt5i3UCDL2alcTH/1aqje6Fvpb3+s6T0xg55VyOwRYfb+zyv9WdyQOVdz RqBtHtHJgqp24UDkQerXPt1WfF3fAWtNdTD4xl6ZH74xqdnW6+GLnnTv44Df02sOn/r6 U2fSc2WCVDkDCLbKw+FV0OpPcfrhYoyPlBpZtaCd9Dvwa9V2Ogpir5kTKovNbZ5BFv3d Hj0FV1gyyjl2iTYgg/txSa+JXLVR+zc4p5VAuFeUh01U5HchLB0/A47TCM5o/o5rq9ry 2lAztYCIoGnQ7554qa8pzd4uM4GIGDRVJ7yofFmIsdvs4X1NoXKAVJZq+VAbKFvrukKd EN8Q== X-Gm-Message-State: ALQs6tAYLmRnT1ubML9DzSzfTS3T0FQaMdV7kSL2c+PtTusheMtFuTqf biqpCN99aoqarngwI2oNaUdQOperM25lLO1ZnoasTw== X-Received: by 10.80.129.227 with SMTP id 90mr30836438ede.252.1524597613903; Tue, 24 Apr 2018 12:20:13 -0700 (PDT) MIME-Version: 1.0 References: <20180424180812.215900-1-wvw@google.com> <20180424145056.7c29ea18@gandalf.local.home> <20180424151416.397fbbde@gandalf.local.home> In-Reply-To: <20180424151416.397fbbde@gandalf.local.home> From: Wei Wang Date: Tue, 24 Apr 2018 19:20:03 +0000 Message-ID: Subject: Re: [PATCH] do not call trace_printk on non-debug build To: Steven Rostedt Cc: gregkh@linuxfoundation.org, Wei Wang , Ingo Molnar , Andrew Morton , Kees Cook , Peter Zijlstra , Thomas Gleixner , Crt Mori , Alexei Starovoitov , Randy Dunlap , linux-kernel@vger.kernel.org, Joe Perches Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org checkpatch.pl sounds good. One thing to add is we have many off tree patches with abuse trace_printk. Also as you mentioned, given this is really not for use in production and we have been cleaning this our on our side for years, could we consider to enforce this in kernel? Thanks! Wei On Tue, Apr 24, 2018 at 12:14 PM Steven Rostedt wrote: > On Tue, 24 Apr 2018 19:02:34 +0000 > Wei Wang wrote: > > We have seen many cases vendor have shipped kernel/drivers with it, and > > have to clean up that every year. This was brought up in an internal > > discussion and Greg suggested have some feedback from upstream about what > > should be taken to prevent this globally besides fixing individual drivers. > > From him "I think this change makes sense at a high level, but there could > > be non-obvious reasons why this isn't the way things are handled right now." > The thing is, trace_printk() should not be used except for development > and debugging. There should be no use cases in the kernel that us it, > unless it's part of something else that should never be used (I use it > for the ring buffer benchmark which itself will destabilize the > system and is why I use it - I want that warning for it too). > Any trace_printk() in a patch submitted to the kernel should simply be > stripped out. If someone wants a trace_printk() in their code, then > they should create a trace event, which is the proper way of retrieving > static data from the kernel. Using trace_printk() is just a lazy fast > way to create trace events. > Hmm, ideally I think check_patch needs to add a warning if > trace_printk() is used. > -- Steve