Received: by 10.192.165.148 with SMTP id m20csp5020683imm; Tue, 24 Apr 2018 12:15:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx48DdcaVFQTc2HhFeGcLNf6HAh54+otLyTt5CRZKwEpfBek0W+FCUqUXkn9eNXO7AF2/Uhnt X-Received: by 2002:a17:902:9881:: with SMTP id s1-v6mr26212509plp.350.1524597344873; Tue, 24 Apr 2018 12:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524597344; cv=none; d=google.com; s=arc-20160816; b=SyLAOF6PDCOHVBflBfdSo103eH/unTkytehkhfOYIRnJMNRlLsGf9S4bRShkPl2UH8 LWXwvhn6A1HIIcdKb4O+JazjdlTh9yGul2zrwf3jkIVbWJkyv9q1KCWQO7v/4QZlDfDo TVdRtxfNMJFHzEdX05u05DKJD3kiTrSF6Z1OqJVl+LXwN3FQNWVfLxnR5BQi0Cx0iPa/ bZPovQ/RPhm2IjO+H7XI2bVAkPTUZGiw4iOCaKT3cvdJPh6TM7f4efyYkfTMwJxW/lsJ paABWySud70lTVXRif+S8cH3f5Jx/VfzRHE50C/7j5rP8Yek9+MMxsKj73BTgWY7TYe7 kSBA== 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 :dmarc-filter:arc-authentication-results; bh=cU59TzCz5ymcXyEisvHUR4wqL4Sk2IES+QsWj6vRY7w=; b=odB4EAuOigmgsgmTtxm3M7lLU+vpK6mlrluF8niXfrH7s0VUY7b51Q8NYq3xtvNSQE 2N4hDZOzszMUrjGeoPnzlpH2qQCdMIsproaNV1m1nawRvVEFPAWsuwrB9Qi3ZSnkg3FC LyZiKyfsbgaPaKR0XhP70rqUpK+04vVglMPBfCclvJhy5PK27JgGYO4aROAY8xe+AEqg DZ/ztJ7CF312qWpMcU613UyOLWZurbiYiOrOkXpUWaTgM/sckrzUbxif+OqkoD4QLi2w 7h/+jPY0x4wiTAGvD6NU6ucy1i1PkKcFMbYLEw5yhTvo0OmR/YbwV0jHuLY+lpfpwAZl cmEQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si10050858plj.122.2018.04.24.12.15.30; Tue, 24 Apr 2018 12:15:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751095AbeDXTOV (ORCPT + 99 others); Tue, 24 Apr 2018 15:14:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:44880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772AbeDXTOU (ORCPT ); Tue, 24 Apr 2018 15:14:20 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (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 4C19B217BA; Tue, 24 Apr 2018 19:14:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C19B217BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 24 Apr 2018 15:14:16 -0400 From: Steven Rostedt To: Wei Wang 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 Subject: Re: [PATCH] do not call trace_printk on non-debug build Message-ID: <20180424151416.397fbbde@gandalf.local.home> In-Reply-To: References: <20180424180812.215900-1-wvw@google.com> <20180424145056.7c29ea18@gandalf.local.home> X-Mailer: Claws Mail 3.16.0 (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 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