Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1514694lqt; Wed, 20 Mar 2024 06:29:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVmvTw1fl7IgIN0goSroPduNdHYfatPSbAv3DWM7HV/wsLFtkiOjmObaf40q3m+gX8AE2p8UZvuL4V0p6kVugE6sgdlKS5E9ucwOB8yog== X-Google-Smtp-Source: AGHT+IHsHnvsrnfFhTVDNfmVqiuS92XpnUd2lhQACASWZL3Sjyu4p+xhLzAYmY7m+rJunPnRlyzK X-Received: by 2002:a62:a512:0:b0:6e7:a2e8:5d54 with SMTP id v18-20020a62a512000000b006e7a2e85d54mr1558799pfm.14.1710941345405; Wed, 20 Mar 2024 06:29:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710941345; cv=pass; d=google.com; s=arc-20160816; b=B2eTWCHEfG/ifqcW2iw9giQbrc/4rf9SQ0jODQ3FHJC24FgZWcnmZ2lOdJfr9HAqVS M4yujhmoKYCUgK2Hiocp6fLN4cPUzAbO1pvyXIYAzhGjJ6HXPbMSLYJOwz7IR8k3uG5G IFuM7laUBnzgDzrYoUfxZbGSiVw6De2gOvJG1wyiOHy1jLL0/oKnXlxZrJkSIPkiccnH m3m1KlrWi1b2OjIACNMV922tPi1chrMALR04y9bDo/JH+5A7amTc1bBKH5U2sG1DViE7 6YydsDVUQq3gLIf4QZppPOrfbv1szTgRsOeD5cXTi6fiSINIEySVYyqM83vvM1vbutIE doCA== 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=P0loKN+XBoUsw9E6J7VcRFd/bEygpRRR+NnD//AYfm8=; fh=Us/DORbzHj5XmgnBeJW+VlCBdo2pSXKHAejHonylCvY=; b=ejiJr9p7WtCFIZzwYDLn1p2RP/T98aLUqeYTPEGsxFc0AM92qIqaGsU2dm7GFxGdFa KVexFY0XUxZEF8tTFnVVbNfmSZzMLm9lXPXcGPA9qn6X6BJblp96lUZeC0HbEWENgopl PefvG7oHTqLV665hvVtCn3ZB+9/BAriF5GarzZdA/DCd+XtXklgpLSetWyuMRuzmJPUM RwPC2TdVJY3Zp7aoyVkSbA9+6tgjmC+4oUvFUj3whwIPZZGvheNwh4GPvTtmVzI6NDHD D0IChw5Bb3tqYIIgRupQdIoegmIb8vxbBY9+H6TdU5ARlt94aI5FWpM7izUeiWFlNSTM CVqg==; 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-108945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108945-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 v18-20020aa78512000000b006e6b70a540dsi12880743pfn.75.2024.03.20.06.29.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 06:29:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108945-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-108945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108945-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 1C56D286734 for ; Wed, 20 Mar 2024 13:29:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E8B847F77; Wed, 20 Mar 2024 13:28:23 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 D1BFC40C09; Wed, 20 Mar 2024 13:28:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710941302; cv=none; b=uqA+YnJgh3WSDvQJUl8umMsPKpl8XqHlKAXrdn/iuZIQQ5ayryTcr6KPCjXZLYcUYNK31VTdtAz09DRzFxiennEeXfWaz6XEYyYcSwTW4DY0RcTKIA8pk7kO/LIBPGPG5w1DE/C5XJfLA7szUPuoGFs/NLYpLsFM2NTDcWiIg2c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710941302; c=relaxed/simple; bh=PAuV3wGybOkWPg2txqBYQgpyb2BYdYoi5e0uWKeMlW0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lTkfP24wKbTOtxboZMRvKWy4OenfC1tmxDwXRSmTPoGjElILx8jrFMCsdidL+bvGfvEQvc3GD9QhrFlxH/RQN/QGZat3L6aAWumeZJv+Xkg2BfwkBv44WFcgH6/ahSKLgJ6vRr0H2GKuuftgdbXhOOBXdxnZndQCUK+/mlZAcHU= 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.188 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 szxga02-in.huawei.com (SkyGuard) with ESMTP id 4V08XC5lKGzbdBZ; Wed, 20 Mar 2024 21:27:23 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id 89F27140158; 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 4/5] selftests/ftrace: add kprobe test cases for VFS type "%pd" and "%pD" Date: Wed, 20 Mar 2024 21:29:23 +0800 Message-ID: <20240320132924.2802187-5-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 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 | 40 +++++++++++++++++++ 1 file changed, 40 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..21a54be6894c --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc @@ -0,0 +1,40 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Kprobe event VFS type argument +# requires: kprobe_events "%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