Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp418154pxk; Wed, 2 Sep 2020 05:19:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzA7vNlr4Ao+6VvnqVH455u+SmKHph3IB/3mWYRJ1xVYopbLzzAHDRmvXHjK30QwafFjzA X-Received: by 2002:a17:906:48d6:: with SMTP id d22mr6218639ejt.462.1599049149445; Wed, 02 Sep 2020 05:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599049149; cv=none; d=google.com; s=arc-20160816; b=jPCfCZX1tVcuWjKLK3tInD+ho+pLfqimaUc213AUP4JlXlr0O3zLrvAKf9o2ZUIEWf 0vUEXCN+K3R+PZFR/sr4xzEckDhuanOgZy/AQ/2fwWHU8ta0ep/foQyNj4ouRsbAtWz3 riVG8RwYbm+cE87yKnbOLDnfqoAHAhjkA05j3WZZqiM8Y2hI5ckdqJfrcdmrBLccnGBf atUWe26/kYA2iysjyNfUNhS8lSF7QT/9Wtp3T2cfd3A9LFhCp5q5iVfQTOFtIaamtcDQ 9AlR3x3AO0NqmDVMdLVJSofom4gnaN5Us86/nynqYvddJxV00yZLOwDFljG2me/xZOXW 7YIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:dkim-signature; bh=/y6Use5/oT/VRDvJxU4PwCfmGC6ZvPkLgQE9J9EIwGE=; b=WNvm579nPh7B0H28bZDytqEq1kuw2HvVcIvGXRQ2nBCkC3AP4som9XLYfVinSlfjuH G1ktqT4VY22pVv7Easm2OFrQZOHAAxXgaqGb+848No4BUoN8I5NiDy4O0J1qYmWqvLaT b7XI1BWWwQ2l1gaidlEgPxO1RI50fF8sc/MX/dVvdLaj9wferDtYgE9szFiEZGGEnkr2 mfl8ZOkkSfVIrK6MKbIqf87YrQegtLOLRKht1fVgTucDRCkaG9RoxKbEQUVr0TUWYV5j CyGKuY0FuACijU5NmPF8foRJCXwo+vAZzACVbFn7DpSFfPoJvOfO2NxVDQu5lAaCF3Dg pfJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=HeY9gr8R; 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=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h23si2591622ejx.550.2020.09.02.05.18.45; Wed, 02 Sep 2020 05:19:09 -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; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=HeY9gr8R; 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=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbgIBMRZ (ORCPT + 99 others); Wed, 2 Sep 2020 08:17:25 -0400 Received: from smtp1.axis.com ([195.60.68.17]:61410 "EHLO smtp1.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbgIBMRW (ORCPT ); Wed, 2 Sep 2020 08:17:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; l=1710; q=dns/txt; s=axis-central1; t=1599049041; x=1630585041; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/y6Use5/oT/VRDvJxU4PwCfmGC6ZvPkLgQE9J9EIwGE=; b=HeY9gr8Rropn0Q+HXF2uNgva/xIdWIXvx/CKhbnGrZ1IS48QDstzxQp/ ho9yG3/UkOmlxYt/8Lr8aQ0wqBPmNjONpCLUAfpp7bVepj0sXjN/h+S8N kk9HngZ5i7YeLDNRRXJx+qQLhMOKKMa5DCgJwRmfrtOdH2CV2JE1IzxQx 2JljWXfNREEyrhFW9p7yY89LF5QTcngAD51Qx8i6XPnFCoIJnA+AalNkL Y6VaGVOqjo5J/6Ea/GjCuzthwzeNxtuHzApX9x0ahu3W7vpi4toGyPoRh gEMF0jUSMXSoR3lAxnoHpvWG/galSusYT+m/ojAqz7KXWi190Qn0mq7iG Q==; IronPort-SDR: 7tGnxBlU7jHCgbF40LrJI+4NjhysGgIf4Ph2563VWwnWsxbLqm1Xc3HSljX1Tztp/0RHIn3++C EXDH9zmv1a6fEAkTqmUi6OPkjDSlLR7w0nFjnQo1p+1L5Xt0EK10+XLLstVJoIgLBwRPQteHzX 4TZo39it1vhE3hE/km7VywXsA3hXXorAZ3lx02WPyCgJUNP/P7lOgd+naATTdcP4zDfTGm448X 8S00fZz7sHJ/JlCyYki9Jg168zKGcRk1Fj5L18YsLftUESZSo5V5U73kgp8x8eR1AOSGdbsLr1 b8g= X-IronPort-AV: E=Sophos;i="5.76,383,1592863200"; d="scan'208";a="12474975" Date: Wed, 2 Sep 2020 14:17:19 +0200 From: Vincent Whitchurch To: Joe Perches CC: Steven Rostedt , "jbaron@akamai.com" , "mingo@redhat.com" , Nicolas Boichat , kernel , "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: <20200902121719.ppj7nyzk2qic5dnq@axis.com> References: <20200825153338.17061-1-vincent.whitchurch@axis.com> <20200825153338.17061-3-vincent.whitchurch@axis.com> <651f7ec449dfb28006bbc0b018d4f6e506bcda80.camel@perches.com> <20200826153203.1a65c35d@oasis.local.home> <9bfb4c4bd1415a8ce527a913730672508a8e8330.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <9bfb4c4bd1415a8ce527a913730672508a8e8330.camel@perches.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 26, 2020 at 09:53:57PM +0200, Joe Perches wrote: > On Wed, 2020-08-26 at 15:32 -0400, Steven Rostedt wrote: > > 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. > > It just seems like a backdoor way to convert various pr_debug functions > (dev_dbg/netdev_dbg, et al) into tracing. > > What's the real value? Timing data? Something else? I mentioned my use case for this in the commit message and why it works much better than printk() for that, please let me know if it is unclear: When debugging device drivers, I've found it very useful to be able to redirect existing pr_debug()/dev_dbg() prints to the trace buffer instead of dmesg. Among the many advantages of the trace buffer is that it can be dynamically resized, allows these prints to combined with other trace events, and doesn't fill up system logs. This is my only use case for this, and I've used it very very often during the years I've been carrying this patch locally.