From nobody Thu Sep 11 15:19:09 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B177DEB64DD for ; Fri, 4 Aug 2023 02:10:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233166AbjHDCKt (ORCPT ); Thu, 3 Aug 2023 22:10:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232164AbjHDCKW (ORCPT ); Thu, 3 Aug 2023 22:10:22 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B1B34488; Thu, 3 Aug 2023 19:10:22 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RH8KR271wzrS4w; Fri, 4 Aug 2023 10:09:15 +0800 (CST) Received: from localhost.localdomain (10.67.174.95) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 4 Aug 2023 10:10:19 +0800 From: Yang Jihong To: , , , , , , , , , , , , , , , CC: Subject: [PATCH v5 7/7] perf test: Add perf_event_attr test for record selected CPUs exclude_user Date: Fri, 4 Aug 2023 02:07:41 +0000 Message-ID: <20230804020741.99806-8-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT In-Reply-To: <20230804020741.99806-1-yangjihong1@huawei.com> References: <20230804020741.99806-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.174.95] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" If all (non-dummy) evsel have exclude_user, system_wide sideband is not needed. Add this test scenario. Test result: # ./perf test list 2>&1 | grep 'Setup struct perf_event_attr' 17: Setup struct perf_event_attr # ./perf test 17 -v 17: Setup struct perf_event_attr : --- start --- test child forked, pid 720198 running './tests/attr/test-record-C0-all-kernel' test child finished with 0 ---- end ---- Setup struct perf_event_attr: Ok Signed-off-by: Yang Jihong Tested-by: Adrian Hunter --- .../perf/tests/attr/test-record-C0-all-kernel | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tools/perf/tests/attr/test-record-C0-all-kernel diff --git a/tools/perf/tests/attr/test-record-C0-all-kernel b/tools/perf/t= ests/attr/test-record-C0-all-kernel new file mode 100644 index 000000000000..2d7549277c1e --- /dev/null +++ b/tools/perf/tests/attr/test-record-C0-all-kernel @@ -0,0 +1,32 @@ +[config] +command =3D record +args =3D --no-bpf-event --all-kernel -C 0 kill >/dev/null 2>&1 +ret =3D 1 + +[event:base-record] +cpu=3D0 + +# no enable on exec for CPU attached +enable_on_exec=3D0 + +# PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | +# PERF_SAMPLE_PERIOD | PERF_SAMPLE_IDENTIFIER +# + PERF_SAMPLE_CPU added by -C 0 +sample_type=3D65927 + +# Dummy event handles mmaps, comm and task. +mmap=3D0 +comm=3D0 +task=3D0 + +# exclude_user for all-kernel option +exclude_user=3D1 + +[event:system-wide-dummy] + +# system_wide is not need for all (non-dummy) events have exclude_user +cpu=3D0 + +# exclude_user for all-kernel option +exclude_user=3D1 +exclude_kernel=3D0 --=20 2.30.GIT