From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90FC9C433E0 for ; Thu, 25 Feb 2021 17:57:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D95DA64F33 for ; Thu, 25 Feb 2021 17:57:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D95DA64F33 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5498D6B0006; Thu, 25 Feb 2021 12:57:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4FA986B006C; Thu, 25 Feb 2021 12:57:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E9176B006E; Thu, 25 Feb 2021 12:57:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 262BE6B0006 for ; Thu, 25 Feb 2021 12:57:47 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D75A8BBFC for ; Thu, 25 Feb 2021 17:57:46 +0000 (UTC) X-FDA: 77857548132.06.A9A24C2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf19.hostedemail.com (Postfix) with ESMTP id 32EBF90009F1 for ; Thu, 25 Feb 2021 17:57:42 +0000 (UTC) Received: from gandalf.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 35E5F64DE8; Thu, 25 Feb 2021 17:57:43 +0000 (UTC) Date: Thu, 25 Feb 2021 12:57:41 -0500 From: Steven Rostedt To: Linus Torvalds Cc: Jacob Wen , Andrew Morton , Joe Perches , Christoph Lameter , Joonsoo Kim , Linux-MM , mm-commits@vger.kernel.org, Paul McKenney , Pekka Enberg , David Rientjes Subject: Re: [patch 014/173] mm, tracing: record slab name for kmem_cache_free() Message-ID: <20210225125741.4fc7e43e@gandalf.local.home> In-Reply-To: References: <20210224115824.1e289a6895087f10c41dd8d6@linux-foundation.org> <20210224200055.U7Xz47kX5%akpm@linux-foundation.org> <20210224203708.4489755a@oasis.local.home> <20210224210740.73273c7a@oasis.local.home> <5a0b6fb4-6efd-e391-45fa-cd188f181d5d@oracle.com> <20210225093128.4cd86439@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: 5jd8qnwnqjfop55isoietew8rpgem65r X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 32EBF90009F1 Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf19; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: none/none X-HE-Tag: 1614275862-792467 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 25 Feb 2021 09:49:15 -0800 Linus Torvalds wrote: > On Thu, Feb 25, 2021 at 6:31 AM Steven Rostedt wrote: > > > > Here's nothing special about %s in TP_printk. It uses the same code as > > printk() and what other string formatters use. > > > > What is special is that the print is on data that is stored from a previous > > time. > > Well, technically that's not actually limited to just %s, although > that's the common case. > > All our magic "%p*" formats do the same thing: they print out not the > argument _value_, but something that the pointer value points to. > > So "%pD" takes a "struct file *" pointer, and follows it to the > dentry, and then from the dentry to the name. So it will in fact > follow pointers even more than "%s" does. Correct, as I've told people about that as well. > > It might indeed be worth having a warning for TP_printk() about any of > the formats that follow a pointer, exactly because of the whole "by > the time it actually prints, the pointer may be long gone". > Just a comment? Or should we add some check that gives a warning for when one of these are used? That can be done at boot up or module load. (note, %s can be OK for some cases, as mentioned in a previous email). -- Steve