Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp596757lqb; Fri, 15 Mar 2024 00:10:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3JzYzjJBMuJRF3DLY3BUT5s+lgJshPfv8jZii1oCrfXg24pHVpVZeouxRQEquyxBRZ6Xdwe9ATa2+DAuDLXgut2uTU82U6f5XG7bChw== X-Google-Smtp-Source: AGHT+IFDFNi/UAfYJSHyq0Ts3va84fRHzBxxB9EvrE3nQMbG8km9RrqaQplU20CNCg31G6zD17Nb X-Received: by 2002:a81:9306:0:b0:609:fb70:2a96 with SMTP id k6-20020a819306000000b00609fb702a96mr4725831ywg.20.1710486647030; Fri, 15 Mar 2024 00:10:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710486647; cv=pass; d=google.com; s=arc-20160816; b=zn9b+kkdN/OP5FfnQfxdbIrLrH/chMfNv/27x8Rcx5POsDJSkFTOumVpwUc4t2GEL5 8QAn3hBQpIbfMdG0Dtk3EPUbOStHudtJwGOnW+YXXS2BYxvBG+x/GhTwfMwkzCwV6ZWf CgpD8U1DE0A+M9L+An+56bPJ1FKQZ7Pa3qUNDHdCDSFkc+BusnnnKtzegSOAKkT0crbN HGFSTLKpZ7cN6Hbp8nR2M5+AXSwf5os2+XBnUY2/TmrhW26X3PdHKAqxGwBJZdT6hlRO y/PchzgdUxHPQz/UlsxY/wYIZweAhal0hZMWcbYm8jrVhCg4Po9lFgvcFETqy2x/YDNY O45w== 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=gksy27rd1Tssu4FbEV5PKzcw0BpgELcRd4FqCrYkio4=; fh=Us/DORbzHj5XmgnBeJW+VlCBdo2pSXKHAejHonylCvY=; b=FjDJipq3gvVEWGqT1c7jNfEIzWR4JDTgmpHxoVcIVAt6N2Jk/Qv6ShStqBdfKpv/0Y yM019JU1Gk9PmawIjsPLNJqImEptZxp2uMkIH+UUTn0TaMCRBiCttZZpWoEWt8yyCXtJ o8aHDgGnBAscDYWfSWJvbdNQcyQ8jkmWCkwjQcxgFNil9NPf/x1vrleCy3rnSGuoP2br Vq3+9MQXURIcin/klwaJCzab7s/7lyjW8FXcZiGuWlcMwyR8HbicY6HsFnmnOF3JdRJC zT6e6ivCMJ51pGXnjl18zkmLtKTfXNBqDTqKQu6ClFXuXhRZp++N8nrh3zMFdQi6dwtf L08g==; 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-104098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j19-20020ac85c53000000b0042ed5ae9952si3048588qtj.270.2024.03.15.00.10.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 00:10:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-104098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104098-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BD6071C21458 for ; Fri, 15 Mar 2024 07:10:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB50F182AE; Fri, 15 Mar 2024 06:54:25 +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 20B9314012; Fri, 15 Mar 2024 06:54:22 +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=1710485665; cv=none; b=DNAdjZJ8Vjsh90bHWrDRMbDIsmrJfnVojAFUtSdcyjKKG01494RjFdnFC9Khm8yfdyyfFvG0+sYVF3OPwyYSCLq1iEolQww+CrrEPfTnh8z6y7RxNUr5rz3bN/Y3p/PoBRG33cRqZE+gVzexH64W2QOPugykaRRdpDRx09/tWoM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710485665; c=relaxed/simple; bh=0/WV/6Kb3iC5gYSeZVx26GoOUUshmVEdVz9ZIolb0aA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Y8dWxQDg3UA20vCmHMN2dZiakXOdctVVpbiBfoXx45mREQur9eVjNz4QpjhNYAPpIF1neqfN87RoIihSf1z9NPJDyAC615D2bbm+wb+WMupOB4bKIQCYw15y+tuBRCndLpWeGyvTDghFiiYnkuEr1k6vUmxgo9lVAQkNPGp51jQ= 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.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Tww2g2ZJzz1FMW1; Fri, 15 Mar 2024 14:54:03 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id 0F13814040F; Fri, 15 Mar 2024 14:54:21 +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:20 +0800 From: Ye Bin To: , , , CC: , Subject: [PATCH v6 7/8] selftests/ftrace: add kprobe test cases for VFS type "%pd" and "%pD" Date: Fri, 15 Mar 2024 14:55:39 +0800 Message-ID: <20240315065540.1181879-8-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) 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..8bea9a75a331 --- /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 "%pd/%pD":README + +: "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