Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1597452rdb; Wed, 24 Jan 2024 23:40:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3DUhiP0At1J60Emng2p4ocxZJTDpI30kiJ763dD3VhjU4eV59F0vmkOTURJAAe+OfiVpH X-Received: by 2002:a05:6402:2078:b0:55b:fda0:4f5d with SMTP id bd24-20020a056402207800b0055bfda04f5dmr181563edb.97.1706168453830; Wed, 24 Jan 2024 23:40:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706168453; cv=pass; d=google.com; s=arc-20160816; b=09O4jhe0hQ/cZBkKoFrqm6i3pCPKWJHKgyOmBgGZtrjl70L4Wcy1+0vrRtRMTuODll AGuJFFSIBeLSsEppVN7QK6xGl8xqKouYJJkyn+jQuqkYYZw4Mq+VnwolJTe32is6mSw9 avtDvjzdwakYOX9b/ZUE56I17cRlxTeA95+xQnvUVUwonugY3KRh9USiQE+KRFdSTZeo stoqps5kui/Z085yzPsiukaDFiSd+eu3c7Rfssyfopij9m7zMMtAbOThkUnSPvb7NGUI uuWWI2A7j2BwiwD89KDqL+lahAUMZbPovvUWRB7YgnDTo69HoUX6pOxW2Ls+cdrpVFm+ Kwpg== 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=pjhzjrZp4DsV2ZV7zPACNyJTM1z8X09IJ5TDj2fpK+A=; fh=Us/DORbzHj5XmgnBeJW+VlCBdo2pSXKHAejHonylCvY=; b=RSsSwLsrfObMhxiuNNcnX9TbcLeB1oAMYn3/L6++xv7RHgPxlyOuLvDVEz8z6p6RXS MJgrn8QEIKJI5YtB4G0x2Bn0dUOONE06m7DTGv5XY7kcs6VTIZEK2QsHp1qgoFVt3gzI +/22NHkqNxY24H5imyHf3N2Nf/U0yFXgEEItfBUFoU/vCyb6y48KjVa/F2okTsHz3yXp N+ks4Gd5mChXRZR/dhIfe787+FE0GEonjJGxkK9DnD7WHY8kW0dcpJ6v/9Oi6qv6wxaU jAxWOQygCV8e111qL4t7rnFFh1/BZfg7xiqDbqK7LUvOmI8Vys53Rr9I6ulxD9maHdyS phaw== 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-38090-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38090-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h17-20020a50cdd1000000b0055cbff8d22csi1592793edj.120.2024.01.24.23.40.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 23:40:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38090-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-38090-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38090-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 886D41F23C54 for ; Thu, 25 Jan 2024 07:40:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58527175B6; Thu, 25 Jan 2024 07:39:48 +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 48A41175AD; Thu, 25 Jan 2024 07:39:46 +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=1706168387; cv=none; b=uzYYvpYrYfeuSYVAvNpTFJOLhNcj3QQswPo7KE8/cQ0xXYdRBEMbFvxhAA1KyRfcl9pYalMULoafKsRIdeMCnWb1uGfE422MYeuAIPbTJ4lRXIOtqXnixFE8c+YvbFvt3GA/LbEJIPFbQiZ7RpFfJ3Xa1/tNPPP9INlNprsGw4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706168387; c=relaxed/simple; bh=kbdMpe4IqkGBetn5w0E/SJbJ+UhnYagZ5GDUcfBAmB8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HzNngnDFxOOAz4lZtm8Pxrf3Pnd00T9lEh8jNVIcDMKkWSqwFyQ5FPA/MUOPHtJoerw8JKxjF3gSqFH4HD3XREHqb5R0x3Dk/5iiiXBX/WJE0/yalbq56zqEK96eAY/HnjQloShRn+YhDSRlroPQjDXCP8xg5L3pdrh55gwgem8= 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.162.254]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4TLCPD3X0cz18Lnb; Thu, 25 Jan 2024 15:38:40 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id 5326818006C; Thu, 25 Jan 2024 15:39:29 +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:53 +0800 From: Ye Bin To: , , , CC: , Subject: [PATCH v5 7/8] selftests/ftrace: add kprobe test cases for VFS type "%pd" and "%pD" Date: Thu, 25 Jan 2024 15:39:22 +0800 Message-ID: <20240125073923.2252057-8-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) This patch adds test cases for new print format type "%pd/%pD".The test cases test the following items: 1. Test README if add "%pd/%pD" type; 2. Test "%pd" type for dput(); 3. Test "%pD" type for vfs_read(); This test case require enable CONFIG_HAVE_FUNCTION_ARG_ACCESS_API configuration. Signed-off-by: Ye Bin --- .../ftrace/test.d/kprobe/kprobe_args_vfs.tc | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc new file mode 100644 index 000000000000..cf0599b90f1a --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc @@ -0,0 +1,43 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Kprobe event VFS type argument +# requires: kprobe_events + +: "Test argument %pd/%pD in README" +grep -q "%pd/%pD" README + +: "Test argument %pd with name" +echo 'p:testprobe dput name=$arg1:%pd' > kprobe_events +echo 1 > events/kprobes/testprobe/enable +grep -q "1" events/kprobes/testprobe/enable +echo 0 > events/kprobes/testprobe/enable +grep "dput" trace | grep -q "enable" +echo "" > kprobe_events +echo "" > trace + +: "Test argument %pd without name" +echo 'p:testprobe dput $arg1:%pd' > kprobe_events +echo 1 > events/kprobes/testprobe/enable +grep -q "1" events/kprobes/testprobe/enable +echo 0 > events/kprobes/testprobe/enable +grep "dput" trace | grep -q "enable" +echo "" > kprobe_events +echo "" > trace + +: "Test argument %pD with name" +echo 'p:testprobe vfs_read name=$arg1:%pD' > kprobe_events +echo 1 > events/kprobes/testprobe/enable +grep -q "1" events/kprobes/testprobe/enable +echo 0 > events/kprobes/testprobe/enable +grep "vfs_read" trace | grep -q "enable" +echo "" > kprobe_events +echo "" > trace + +: "Test argument %pD without name" +echo 'p:testprobe vfs_read $arg1:%pD' > kprobe_events +echo 1 > events/kprobes/testprobe/enable +grep -q "1" events/kprobes/testprobe/enable +echo 0 > events/kprobes/testprobe/enable +grep "vfs_read" trace | grep -q "enable" +echo "" > kprobe_events +echo "" > trace -- 2.31.1