Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp597983lqb; Fri, 15 Mar 2024 00:13:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4Y8EShvOGrx+zb/+ZX49mLfh20F2Odfb9FK3oiVPNfog+EJCQ/y9mSt0hPMeVdVs+pDB4yofKtYaHIIMtiL0uTOaMig3/DX/1GVLBtw== X-Google-Smtp-Source: AGHT+IFJucRp5dV8rEzZr68BnG2Ns9gHBVhVu1QqzRIeIEIQfG+FMmj5VgMHemetQCEs24P/jhl7 X-Received: by 2002:a05:6870:32c9:b0:222:8943:df2b with SMTP id r9-20020a05687032c900b002228943df2bmr717730oac.16.1710486826119; Fri, 15 Mar 2024 00:13:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710486826; cv=pass; d=google.com; s=arc-20160816; b=nkn0v1dseUVaCrjPwHfUQsC35CfP/BbUwuOXbzMwHeljKZPYQ++Uvbw66dKbiyFdRu YzmG3wfGhFb028aDveZMqGYkoeXsUulQKZnrOTEkctdsF4TI/fCWlVaFdJCjS6a0VpWU CyStsIC5A/VyH3VJ0M9Ax8tbBWEl3M9zA/iBdSuQ/uwvkmGyv9xSlV/61zAlijZ5zghd vQrFCkMozYe+7fDfG0CjzKQ/T/179lzRtQ7UJmpev79So+odBtsR11iFY4gfUF7cVicW z3qrYtAm2s7KhC1BBVLSZ+MtN9hvR0Nmp6zEc8kAlBUdkmDjT+izo7pgeTrN3uCs9Vso jNEQ== 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=iT4NkNErjpv2baPNdwTIlCyAK8qqgAx7kAe129L9Lc8=; fh=Us/DORbzHj5XmgnBeJW+VlCBdo2pSXKHAejHonylCvY=; b=GsCu2+cAgLo7fckUboSqIkLofc/923SV7yNMTziPlWHxBv8LI24Wjmv6its2KWPjpw paVx05ScTErjU8XzPsMihpzyvDCLCajX5OwUCqp2B5UzoZTnVuNURSye81OXNVHue0hR R+uAUE9heE0w46DUTcdp29JRW1/eBbA5HSmjV6b3H/ju/1BvqIhkh9h8AIb1qDSTkbWU r1OWrZplimgsYtxIVfOdAFRi/unnLoRNKn/i0ic/nEFmGWM0YtnlDgOVSzRYvYO0VZqW 5iuykA5OlNBFWWJ0wal1/E4RN/ajWb16JJy9jY+Y/FycIUlkzjUxR+jfj3gOOqNP0IoU 38Xw==; dara=google.com 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-104099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104099-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 c125-20020a633583000000b005dc4fca7d3csi2141498pga.200.2024.03.15.00.13.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 00:13:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104099-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-104099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104099-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 A7395282BB3 for ; Fri, 15 Mar 2024 07:13:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99E2418B04; Fri, 15 Mar 2024 06:54:28 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (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 5C42118637; Fri, 15 Mar 2024 06:54:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710485668; cv=none; b=AwxyT6X1hcKRNkQ3vJyWP0oOgiyGjl+typHq0JxrLTcxgpXf2/tuXYyM3MscX2nnPCa3CYX9aOItVKjW8WRUSFfLxfk0s6StPrsrInTk4SnfPTkq2BLGUBtwG7Xz5q/ddxCU9EvxjHKWGnHH5mKGOe01elEQyuvfLJhucQGGZq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710485668; c=relaxed/simple; bh=WuzOu1pbLK1l4Mw333eghX00jBYu4yVSy2f2BXI6kRU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cO091kP9nJZmBy1tBtU88VEQss6p2YGvZYYFlh7vUjNSpdXWWvaMStOnVOMz7fpvoyictAYyTxZimXFW/TF01dm3CwqON23tUOeioejvNB9f8qX3l4qcwqYDF8HnJow9dleZzWk/bJCKljst/6U9LlJIjETyASmHjBCFfITcl/4= 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.255 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.88.105]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Tww0T74fLz1Q9gW; Fri, 15 Mar 2024 14:52:09 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id 4858F1404F3; Fri, 15 Mar 2024 14:54:19 +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_256_GCM_SHA384) id 15.1.2507.35; Fri, 15 Mar 2024 14:54:18 +0800 From: Ye Bin To: , , , CC: , Subject: [PATCH v6 3/8] tracing/probes: support '%pd' type for fprobe Date: Fri, 15 Mar 2024 14:55:35 +0800 Message-ID: <20240315065540.1181879-4-yebin10@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240315065540.1181879-1-yebin10@huawei.com> References: <20240315065540.1181879-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' 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