Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1514692lqt; Wed, 20 Mar 2024 06:29:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxsQYQdwtm9Hwe5taXEEJY68uZVUwOqTptwbQV9DSonF//UPVInr5BMpVb68tStE09cL+8PvlDSvbKIgxxbXSXRGwRX/R400P2oN5X2w== X-Google-Smtp-Source: AGHT+IFs168WqBhYEv32NHwvOUw8SWzB/4y2spj6RRbW2SorQxqg1BO2nJhhmTOVOFLnl+Pg+KCp X-Received: by 2002:a05:6359:4591:b0:17b:b559:2ba3 with SMTP id no17-20020a056359459100b0017bb5592ba3mr2075017rwb.11.1710941344976; Wed, 20 Mar 2024 06:29:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710941344; cv=pass; d=google.com; s=arc-20160816; b=0/K4cW21TudmS/28onYg2r92zOERcIOZbeFoYkGRQQzspiPRQmOS0itaWGiBIyPI0U OgqcUYyeD6e5MiP/BrJ5VPYGfhzAKrQ4a+ac6cxq1CSAQ9eU4lTI0Fx10KB0SSU6YVsh 4SNmT1N6KRNBWffT0B+CrOC75F+8w665665cYdEUovIh3ijC43Q01CBP2z9P+YN5lo2C zPCT6dupR/7S2kxiCCyYcdsZffF6l/wp6LSRT77tz13mkwvGb5HpyyI1bZhJ7SNGw8h9 uK3iI8jqcfmjFc2v3okQm86stvoSpUuOaCxGwybcn2Se4DQZC+ET+P/TJRBoy8EUCGS1 yTlQ== 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=qH2LgOs6HGP8lPbOIMOB4bsuglsWWackLGbg3Vw2ef8=; fh=Us/DORbzHj5XmgnBeJW+VlCBdo2pSXKHAejHonylCvY=; b=OeqFwBqKF/G537vgvQ1OF4eq1oohO/hI1/0ymiAxsew/zrji2TkJFeaFeFTj7Ob+6I MrZBJumYKiW1r33CIRIFrMm7oPiLmY8Y1cCdUsh3t+CdLCNEBIGxL1PFRXnJC9pM3EsD DePvdxm3HMs7vQH6pAvdy9Q1X7Woher/Ecv2nBrH0VXGN7Jtm6kMiIofD/ls6U4duNUL 8Gx+WaafjFRWf+7onI9kVqeh9oeVhSe7BBT5ADNks47WiyTcTLd3sqrY5KcNk1wM3oBK xZLt3muuirnTZxCHIPbNLKtzet0UpcV8HALiIEowD+19Yi904vPkJrDfjIlpfpH2xr3k ObsQ==; 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-108944-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108944-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 z16-20020a634c10000000b005e42b4bc580si12637900pga.817.2024.03.20.06.29.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 06:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108944-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-108944-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108944-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 9F2FF286711 for ; Wed, 20 Mar 2024 13:29:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C41E47F72; Wed, 20 Mar 2024 13:28:23 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 A94DA40BEF; Wed, 20 Mar 2024 13:28:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710941302; cv=none; b=lG88WjDTTnv6Y7v81nSDvPJQoMs5Xb8eijRn1TTCRkv1WkLAafJGG86jCPIefgQBDysyzk10VZUsUwoXzM2pszfNqea6PfJbLYq45OGhe4WYnfBXtKCAXRCwddpnZ/gUwNhlY/em4qUEaN8GVe2aqIt2pVFYb9I/mOOrTHyfeNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710941302; c=relaxed/simple; bh=mm/LKOibx69xdWi9kZO3FwKzMXoZWR3O/2RiRcPvCZk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C8zvNqaoQXWfd+/+w2Y+GwDFrlnY9nph2egzIgdP6F2WzFV2Y2aRNCvO3c1awu3EqUlI5OKTt5aL89/qf0AX/4ETqC4v9xZe/iN76zNaXgh9/A7MH7u+dVB3210HsWB6yOJvKlclYklhvHWNKkh+lIcwAbDitAEnE8JvkVnozLQ= 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.191 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.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4V08VC4WF2z1h2lV; Wed, 20 Mar 2024 21:25:39 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id F1CCA1A016C; Wed, 20 Mar 2024 21:28:12 +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; Wed, 20 Mar 2024 21:28:12 +0800 From: Ye Bin To: , , , CC: , Subject: [PATCH v7 5/5] selftests/ftrace: add fprobe test cases for VFS type "%pd" and "%pD" Date: Wed, 20 Mar 2024 21:29:24 +0800 Message-ID: <20240320132924.2802187-6-yebin10@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240320132924.2802187-1-yebin10@huawei.com> References: <20240320132924.2802187-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: dggems703-chm.china.huawei.com (10.3.19.180) 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..49a833bf334c --- /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 "%pd/%pD":README + +: "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