Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp359221pxa; Wed, 26 Aug 2020 12:34:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp+WD3IE5oyhqq57EwV+mlPteABEodEwlCuhl1OzJsVYPZNxBIMom7egoPOKKVCQrj38j7 X-Received: by 2002:aa7:df0f:: with SMTP id c15mr13357331edy.293.1598470496929; Wed, 26 Aug 2020 12:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598470496; cv=none; d=google.com; s=arc-20160816; b=UVhNV5fMkzoxg2dG5uldOQt268WBoOMqjgcs8v7PIMAdX8USfaPlOOL7+AfE02lKbS dawPMVvrrUK+8jLIfByDKTUwJXBUxE4DGUqlI7FxulchuVtLRHOFQGif4wDrYont1pWe NqWZik/UghfRqFkXlhe8dELzCaiPGX3pmhEoFQEztUNRoUluVmW6X8HoE88i5bb6cnjr tqRxQZdrVUAbHf1cKSb8BGx2y5Owboo7AJaUgpW0yGfF70t0rOIg6KdqSMbp02mS4Vm4 rKt0qHw8JtsFqzcSWqxE5VuFtC/tHsUUYqMXEHG86Kz3wl98aAlrU0U4pQCbThfEP1XA FMag== 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=01/cWvUkwYvaQPRMVzyZW8KsPFMPB7CukpSQnVNMVAU=; b=MNZOL9cIzFHPO0h2CUqnibEcxz1jV9i7wZ8fwm6YYFPz7JHjKztqUwTon0LCLkaf68 Ppfk+D/hBkUQ83ePGPCVvRYFYkXBIH0+dzLcatCLNKUfQcfjkLDoHH2AKrTdXJEB6eGt /XtIT1e5JB/16gP7DUYBldBWXXIvrZzMQdredPxHOUMCWVfNa8RJV1fPuAKpFqMoRM3m 6ZTb2UeCG9V8BJmNxxRik+6DYXnhLCgV9e+yWSGcoXcdvhrFvCIpev5uoXubXy6mpPBK CHE8q+3yGDX1OkNWDeK6fNyfsQU0aktOOXBQE37nWe80sz6iplgEs+b9YzQKZLpsMy04 Nbzg== 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 s15si2254207ejx.745.2020.08.26.12.34.30; Wed, 26 Aug 2020 12:34:56 -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 S1726820AbgHZTcG (ORCPT + 99 others); Wed, 26 Aug 2020 15:32:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:46106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbgHZTcG (ORCPT ); Wed, 26 Aug 2020 15:32:06 -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 D6CB92076C; Wed, 26 Aug 2020 19:32:04 +0000 (UTC) Date: Wed, 26 Aug 2020 15:32:03 -0400 From: Steven Rostedt To: Joe Perches Cc: Vincent Whitchurch , jbaron@akamai.com, mingo@redhat.com, Nicolas Boichat , kernel@axis.com, corbet@lwn.net, pmladek@suse.com, sergey.senozhatsky@gmail.com, john.ogness@linutronix.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] dynamic debug: allow printing to trace event Message-ID: <20200826153203.1a65c35d@oasis.local.home> In-Reply-To: <651f7ec449dfb28006bbc0b018d4f6e506bcda80.camel@perches.com> References: <20200825153338.17061-1-vincent.whitchurch@axis.com> <20200825153338.17061-3-vincent.whitchurch@axis.com> <651f7ec449dfb28006bbc0b018d4f6e506bcda80.camel@perches.com> 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 Tue, 25 Aug 2020 08:53:25 -0700 Joe Perches wrote: > > The print buffer is statically allocated and managed using code borrowed > > from __ftrace_trace_stack() and is limited to 256 bytes (four of these > > are allocated per CPU to handle the various contexts); anything larger > > will be truncated. > > There is an effort to avoid using trace_printk and the like > so perhaps this feature should have the same compile time > guard. No, this is fine for being in a production kernel. Basically, these are simply debug printk()s that can also be put into the trace buffer. The key difference to trace_printk() is that they are an event that needs to be enabled to write into the buffer. The problem I'm avoiding with not letting people add trace_printk() is that trace_printk() should be used when a developer is trying to debug some code. The *only* trace_printk()s should be the ones that developer adds (because it only shows what they want to find). trace_printk()s are enabled by default, and they have a special switch to disable. But it is an all or nothing switch. They either enable all of them, or disable all of them. No in between. Now if we allow trace_printk()s to be scattered through the kernel, when someone wants to use trace_printk() for their own debugging, and it is turned on, now the trace buffer is filled with a bunch of "noise" from all these other trace_printk()s that are scattered around, and the trace_printk()s that the poor developer added are lost among the sea of other trace_printk()s, making their trace_printk()s useless. That is the reason I try hard not letting trace_printk() enter into the kernel. -- Steve