Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1597273rdb; Wed, 24 Jan 2024 23:40:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLJoGS60RhUFSqlLESHJI2AaSmvDrW0d1HN92UOom207PlGQFxeQqVY1ZPPJYQRdMHh60g X-Received: by 2002:a17:90b:1097:b0:28e:7b98:b799 with SMTP id gj23-20020a17090b109700b0028e7b98b799mr231773pjb.93.1706168415660; Wed, 24 Jan 2024 23:40:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706168415; cv=pass; d=google.com; s=arc-20160816; b=S5I2DmfX2UaugsFuF8OeE7htP3BJxO1MI8DllD4z6NottAptri9t4i0ahTW+KPrUDO +Y2kubfFp8NSae7ku4W+hwuoUxfugjHUVxl4/jUQ4ArYyoCLz0EL2T5mkSKXaPxsrOUe YbyxwW8HO8s0m3nkMTiVTWW+EVI9m5+Bj+oMDm8DkpN0A7XTTMnxrDHmajhAaA/80kbR SWydtRJElZCzoIx+udEfyJR43x0QYY9FsEFEv9YQi40qiBdBMJDAb+cHuhCEh5hjPwEL zYSa4CR4MKs2qHYKf77FsN8KcZ+JRtEPe42pxpjwddiHVRLoZ4icr13cuNgiGth4PkPr jmQw== 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 :date:subject:cc:to:from; bh=a+0pwTSGQZhnUjlz7LDb4LLJZ4HAAcLJsb3zXO0C9EE=; fh=Us/DORbzHj5XmgnBeJW+VlCBdo2pSXKHAejHonylCvY=; b=Yub3D/zr8j54MzBpSqBFbOPQrxH1zjN+2EjuAPuIavJJctRvb14/1kW99M80ksbgAK qxRBMS43GLZLUqZj4VbmcftW/cqFASW1XEtWDAMCefGAif21aLz6wjN47qrW6eM9wtN2 rCgtAKlEFoluImcnlV57hHbGoUiik67VBpxvHWSKvo8D+z/+5hnvcKDitpcCBqEZjNmI fIuqBEKYGlJyqOxMBdXkfC3vONA32yhp85F+XM1WKw3XNsd+YfekEox0VV9wDikfd2m7 ertO3NNtdpSqujCvx3nlzUoByqWA80JplGkYWiVopqbWFj/gyh2w9ypfxKieRWyXsp6a BsRA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-38087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q11-20020a17090a304b00b002907545330dsi879422pjl.89.2024.01.24.23.40.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 23:40:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-38087-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4F681282B81 for ; Thu, 25 Jan 2024 07:40:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F4B812B97; Thu, 25 Jan 2024 07:39:34 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 5B1E2171AC; Thu, 25 Jan 2024 07:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706168374; cv=none; b=X7sW7TjcoWqn4MuQt5w8nDcknvHpSVPkLSjr1+FxLzQXOsGnpqshXt5PE8esZo+DkRhCaQnoUBvExqLKaTYnIDfOlEBtYMHZnieer1JO1K/htuw45kCmqDhupnbhxF+4RdyP/BD7gW8SNB6EPJ9YNzvs0bmMi+qkraE2YpPzdm4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706168374; c=relaxed/simple; bh=fL+61EE8VfS7TSQ3fjCfD78Ystne/UYrNzobZfLfpQ0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Z7ssflh9J/LTKlZ0FTBUuatS0ppFW60ivAk/+EToq3Fnnzk4YhukQJ05LGtNbMQifEdIMMdHXJ5z2pHvPmF/IDLemtoMnC4isSUs+G28NslxMpJkaNewTD5do0dgNd3YRRNXhB9JhxswBC9+28O9O44jzpVIu5GtkOgpuiiT46k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4TLCNx2BYvzsWJS; Thu, 25 Jan 2024 15:38:25 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id 4ED5E180080; Thu, 25 Jan 2024 15:39:14 +0800 (CST) Received: from huawei.com (10.175.127.227) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 25 Jan 2024 15:36:52 +0800 From: Ye Bin To: , , , CC: , Subject: [PATCH v5 4/8] tracing/probes: support '%pd/%pD' type for fprobe Date: Thu, 25 Jan 2024 15:39:19 +0800 Message-ID: <20240125073923.2252057-5-yebin10@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240125073923.2252057-1-yebin10@huawei.com> References: <20240125073923.2252057-1-yebin10@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500010.china.huawei.com (7.192.105.118) Support print type '%pd/%pD' for print dentry's or file's name. Signed-off-by: Ye Bin --- kernel/trace/trace_fprobe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c index 7d2ddbcfa377..988d68e906ad 100644 --- a/kernel/trace/trace_fprobe.c +++ b/kernel/trace/trace_fprobe.c @@ -976,6 +976,7 @@ static int __trace_fprobe_create(int argc, const char *argv[]) char gbuf[MAX_EVENT_NAME_LEN]; char sbuf[KSYM_NAME_LEN]; char abuf[MAX_BTF_ARGS_LEN]; + char *dbuf = NULL; bool is_tracepoint = false; struct tracepoint *tpoint = NULL; struct traceprobe_parse_context ctx = { @@ -1086,6 +1087,10 @@ static int __trace_fprobe_create(int argc, const char *argv[]) argv = new_argv; } + ret = traceprobe_expand_dentry_args(argc, argv, &dbuf); + if (ret) + goto out; + /* setup a probe */ tf = alloc_trace_fprobe(group, event, symbol, tpoint, maxactive, argc, is_return); @@ -1131,6 +1136,7 @@ static int __trace_fprobe_create(int argc, const char *argv[]) trace_probe_log_clear(); kfree(new_argv); kfree(symbol); + kfree(dbuf); return ret; parse_error: -- 2.31.1