Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1598978rdb; Wed, 24 Jan 2024 23:45:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAxfwKUoSxUtcx5auwMGkLzhH7+TzGCktpaOrDvJ1i7eDRdlZwntK9W/nqAQEOc7p56bLE X-Received: by 2002:a05:6358:33a1:b0:176:502c:857c with SMTP id i33-20020a05635833a100b00176502c857cmr811610rwd.40.1706168739904; Wed, 24 Jan 2024 23:45:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706168739; cv=pass; d=google.com; s=arc-20160816; b=aVRtHmAvAXBxmJdxHHUSiRtS06IImCagERRQJlFUhVpfWEdN92vOFtjxDba/lvWscZ iuo56WCiPMFAngcGlXE8KaDkjfXE4GID1DLezRVjRj4eEO0QaGbBDMUBHxvTsG2OrbZe dFXYOU2EEvKsP62RkifEw9SzyuwM8uEpvolGbi50Gt7j+oArUJdq/6NOOCxXEI4JM7V8 NwvemD6SGcOY9OZFHWvsAaRk4aQp8NKnzjSjWVjHSXzRh9xy6AOio/2VrrlEaOCGYyI9 DH9jOj10VmrHJyev7jvPbdknFDgmnxOslt9yAbllQ+EEa3SgNBtia48BvkD0cNRgDG7O 6q7A== 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=LxNHLieK4UJW6ik3nQK7fsI8uBV8QZi1E5F34RWBW2s=; fh=Us/DORbzHj5XmgnBeJW+VlCBdo2pSXKHAejHonylCvY=; b=bCObJ4XWHCu2OcXn1fo2ACcnCs5FJvzfA/aVn4jowydY6choeFkFnjWXELrbMdq470 uzw4X9VuwtfJfq58AVGMw3MxiM2Kcw0co9khTM9IPz8IGk9owd6DHoXy0FX0HU5/fLuJ zyI1CVBgKRb3wQJj00ueezZwcDJjMCjcvjVei8CeXSTD4biNWOVJJ8kLswxHdRFSFaFA 3aSb/sh+BTWekOY/qtsWgzhO1bWu9KzOaHtebEZ+52MJUOeqPY2MYimE2dNmvqS+7Odb eYS6NAhPCOzDPErtCkgxdA3XM03YsdEC7XlKLytcdfnzewq4y3tZgT+9S1c4pJ0OBNeM YLFA== 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-38091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38091-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 9-20020a631549000000b005cfda894ad6si4776063pgv.801.2024.01.24.23.45.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 23:45:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::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-38091-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38091-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0F18DB2653E for ; Thu, 25 Jan 2024 07:41:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19B3A134BA; Thu, 25 Jan 2024 07:40:04 +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 CEF3F17BAE; Thu, 25 Jan 2024 07:40:01 +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=1706168403; cv=none; b=SR2jdrvqLnpOa+FuolKyKvhdSKmIJUBX6bmlCDPE8AAIsUGRwBLhMhPm5wZl63wwGy/tI7KD2skm+m47ci8g3/LRmtCWPIlZeMyb0qVt2++o807EXx3OfjYGn1IagMQK8Jg/HybUNKjccErrcJBUJ5NuBfBZ0byPreTvfrzoj+g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706168403; c=relaxed/simple; bh=Di5QFTkBZO4/CVl9f+evbhAXhnNNLRMry/k3VXo5/Hs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LysK3lS9382xpMooisgpX0iBbGXV1Ubh00tMNXws7aPLGA58acAp2UjlwHAwksqXYyS69ufiaxGniEaHx7YGUlggQMWcYGxNjhFV5EKY4av8KibGfVe9GlxcDbeDOzf6OHoVw2xrw7qRb+/vXAOkPG9i0gwDN+iF/u8IdyAST8k= 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 4TLCNy19qwzhZPy; Thu, 25 Jan 2024 15:38:26 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id 575A9180083; Thu, 25 Jan 2024 15:39:44 +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 8/8] selftests/ftrace: add fprobe test cases for VFS type "%pd" and "%pD" Date: Thu, 25 Jan 2024 15:39:23 +0800 Message-ID: <20240125073923.2252057-9-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 fprobe test cases for new print format type "%pd/%pD".The test cases test the following items: 1. Test "%pd" type for dput(); 2. 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/dynevent/fprobe_args_vfs.tc | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/fprobe_args_vfs.tc diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_args_vfs.tc b/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_args_vfs.tc new file mode 100644 index 000000000000..0a5baaffc137 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_args_vfs.tc @@ -0,0 +1,40 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Fprobe event VFS type argument +# requires: kprobe_events + +: "Test argument %pd with name for fprobe" +echo 'f:testprobe dput name=$arg1:%pd' > dynamic_events +echo 1 > events/fprobes/testprobe/enable +grep -q "1" events/fprobes/testprobe/enable +echo 0 > events/fprobes/testprobe/enable +grep "dput" trace | grep -q "enable" +echo "" > dynamic_events +echo "" > trace + +: "Test argument %pd without name for fprobe" +echo 'f:testprobe dput $arg1:%pd' > dynamic_events +echo 1 > events/fprobes/testprobe/enable +grep -q "1" events/fprobes/testprobe/enable +echo 0 > events/fprobes/testprobe/enable +grep "dput" trace | grep -q "enable" +echo "" > dynamic_events +echo "" > trace + +: "Test argument %pD with name for fprobe" +echo 'f:testprobe vfs_read name=$arg1:%pD' > dynamic_events +echo 1 > events/fprobes/testprobe/enable +grep -q "1" events/fprobes/testprobe/enable +echo 0 > events/fprobes/testprobe/enable +grep "vfs_read" trace | grep -q "enable" +echo "" > dynamic_events +echo "" > trace + +: "Test argument %pD without name for fprobe" +echo 'f:testprobe vfs_read $arg1:%pD' > dynamic_events +echo 1 > events/fprobes/testprobe/enable +grep -q "1" events/fprobes/testprobe/enable +echo 0 > events/fprobes/testprobe/enable +grep "vfs_read" trace | grep -q "enable" +echo "" > dynamic_events +echo "" > trace -- 2.31.1