Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1088565rdb; Fri, 19 Jan 2024 07:52:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEeTUMcSrjR29jhv1J+F1BBzMzreiToO2hCn0rBZBz4q8ehu8esNI2RiBjTU04F4aHTjCr4 X-Received: by 2002:a92:b74e:0:b0:361:9249:5aee with SMTP id c14-20020a92b74e000000b0036192495aeemr8307ilm.41.1705679521562; Fri, 19 Jan 2024 07:52:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705679521; cv=pass; d=google.com; s=arc-20160816; b=eq/vNK3zH659JCqJ7ZgZUKXizCoX7V+gkrvFCupUC7pcbT2v2l4MYsWFZgCDP0reLr MR9Euz4EoXb+PJMviiy21Foud9zMFUxislhwUrQDsil1w+zBuWBqm2859x2Z/JZCLCf3 LdTotPLvWn9UxGgnDqdfOSNH3wmhHUurtHu45XdUUJ14VhRezd7MzpIik7mIFm7r8ERC HTjiVbNUuBYpH/ehY4qAyNkP1A1xn61YnuXG6lNF+3bD4hbFczl4vP7vC5UpgmC86LxX iT+lb0ZXaCZY1ZsNQ5m3kPVYGuvP0a0joDu4BtrAP8tgzzycXmcwkn1C4gbTjUZQtw5Q P+WQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=lrtln0An9wnZBcy8viORrvNelMsHHGvSABHL6wGJf48=; fh=oAUG/CiQ3c1zuquJB6fiUvXT85e2e943kynEe8c2qUc=; b=CnRsjdhOIKl0iP21kqo6Ixsgz0Zr0cfk9BJ3+FvQG1HqHiKpKujbBb8SXJdjc008m1 nxpEfkOJp8ZSg+fxlO+c0ZQO1JdeGNPc2IT4x2hkRVfi21fY+eQ2i3ZJM5Rv8+kdW+TG kaogfcSaiWqQm7EctEhS7nThJI9NS0F0KBZJ//aZr4XKkSWkHMgyhHjfl+8hKv26umsl x6TItXlghBqA7G5ox9swwgO4eQ9XqE728HVgBY/5ZFHiZoT1SaRIXWT7ckutVMuAF/Fy mWcirlBOF7SGgmH7zvSuZQH8hdrfI97raWqFOox8Alkqp1xQrybaFneq5HHAgiB4znHB T+yg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-31327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31327-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l4-20020a656804000000b005cdfad41c2dsi3519413pgt.803.2024.01.19.07.52.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 07:52:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-31327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31327-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 294E9B212EB for ; Fri, 19 Jan 2024 15:51:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F35E154BE3; Fri, 19 Jan 2024 15:51:23 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A63A54BCB; Fri, 19 Jan 2024 15:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705679483; cv=none; b=UDvy9nGg6Nu3qOTaZb5T9vvt96WKDHZJU8Ax+60Fob3rlKY+SZ8vs/E5Il9LuuNidR+sfZw0T07aC32t1AA8L89z0YK1oUwCNNiEwneUN52ZzxrWbCXfGIcNOAg8W5+CVdHhv0VNrGsRbqa6fNoMATYjFvJWPfOxpYSdgxgZ9aM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705679483; c=relaxed/simple; bh=uL8bmAJV9MR6t5URe6D74sB4jCxEuSzYMTv3ufe3d70=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Nfr37f5UUcht8FEoIOH7AiwuzWcTfOzkqAPNFM0KW+JmYck2MdJpvv4gIKZxxIRNyFnSwJUiIztJoEJn3m8XxT7w9bd+1ydc/jP5vv98eV8K1aS9JFuC9il7j2k5Yy0jVA6IrpV+72jpiglC34W1V1LPqejrB3+PaivSnKmBhIk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 391F5C43394; Fri, 19 Jan 2024 15:51:22 +0000 (UTC) Date: Fri, 19 Jan 2024 10:52:43 -0500 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Ye Bin , , , Subject: Re: [PATCH 0/3] support '%pd' and '%pD' for print file name Message-ID: <20240119105243.05082e5b@gandalf.local.home> In-Reply-To: <20240119234356.1598e760edbfa58f5440a941@kernel.org> References: <20240119013848.3111364-1-yebin10@huawei.com> <20240119234356.1598e760edbfa58f5440a941@kernel.org> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 19 Jan 2024 23:43:56 +0900 Masami Hiramatsu (Google) wrote: > Thanks for your proposal! > > Generically, I think this type of hack is not good for the tracing > because there are already some ways to do that. e.g. > - Use perf probe to specify dentry->name:string or file->name:string > - Use BTF to specify in the same way (but only for function entry) > And those are more obvious what it does. > > However, if this is implemented in more generic syntax, it will be > acceptable. > For example, type specifying with "arg1:printfmt(%pD)" will be > more generic because it is apparently one of the printfmt and output > string. Or, maybe we can just allow to use ":%pD" as a fetch type > (start with '%' means the printfmt) Yes, I like this idea a lot. Please add the '%' keyword/token to change how to display this in the print format. We may need to add more than one token though. Is that supported? $arg1:u32:%08x or that could also be: $arg1:%08x:u32 That is, the order should not be important. Thoughts? -- Steve > > Also, could you update readme_msg[] in kernel/trace/trace.c if > you add a type, and add a testcase of selftests/ftrace, for this > feature? Documentation should also be updated with more syntax > information.