Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp1194106rdb; Sun, 20 Aug 2023 23:08:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2pYBXrXzptwzV5X5iJ4glLUjFmTwRFYrLCBj5gaM1Bv14KaxZAAmAS6cDkH7xbnjwMqdY X-Received: by 2002:a05:6870:b69d:b0:1bb:77b0:f3eb with SMTP id cy29-20020a056870b69d00b001bb77b0f3ebmr7499495oab.4.1692598095500; Sun, 20 Aug 2023 23:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692598095; cv=none; d=google.com; s=arc-20160816; b=nVddvMLX+NHg7dgXN7dkPWkBrMRn+hddZHZMlnf2iTpmaW8d5wUr4ZWHscGlkoaDG0 J3xuLoeBY6Slt7aKTIR9hTsMtlJnxJ3TE6oI8mXS0sbrnfTD8SYMy5gwiXIHvSyUNXrX Ed7DoT/HYO+sH4iWBItCxTQCmTdl1jQImjb3VvGZ3zjf1FwMNaadtfLd+qUXygkRSwx5 +4kALnalO2VqsXqF9bZgEK96Ovfu/FFpHYTsDWHo0ZGWtJMWp1dZ8cDuGXSvs3r4DEW5 m54sId2JbIvM5h8r/IiiE62Hvy6orzgFS6RO4PfIlm/qM5N+8bl5vWlze1GP57rb+EQt oWYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=g3pdwHgmY7evmW6P2UQXVdPfh0DuDDsfo4UyXH9W6iI=; fh=Ib1wi7jRbo+eNDLEErvWCJx+cnUm87PkGFthhdFf08Y=; b=r19rYdaRcl51BGawvalD63v7TYhQGD7DwrVdCusdQRWf8Y6C42eC8yNr1v4FydwsQD 5SkO3CNHghUsyax8LvVBEjxSCG8PZNu5orejBOfC4rk67QQwSAndp0Z/8rir2nQN70Os MvkzZZRaJjR2BS1l4GJsbSx3paqRyuMr80zqdP9vISWHuYcOmJfcN55rJ+PA6fgr+ji6 13PF7Ou9wnXUEH1RaCdwEF/1JU3e3nbSjygCgfRM3UjmejKA4FCZPVMRIZWRrOVmR3KC SoS3Bfx2/Pf+EHAtJNRz04+BRF17vjqYo0a8T1u6NZ0/DGguScSyURZn+JupziW5qwY/ kSaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fs20-20020a17090af29400b0026d4e16c957si5792004pjb.77.2023.08.20.23.08.02; Sun, 20 Aug 2023 23:08:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232470AbjHUBaq (ORCPT + 99 others); Sun, 20 Aug 2023 21:30:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232434AbjHUBai (ORCPT ); Sun, 20 Aug 2023 21:30:38 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66C3CA8; Sun, 20 Aug 2023 18:30:33 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RTZZd6Q3rztRpW; Mon, 21 Aug 2023 09:26:49 +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.31; Mon, 21 Aug 2023 09:30:30 +0800 From: Yang Jihong To: , , , , , , , , , , , , , , , CC: Subject: [PATCH v6 7/7] perf test: Add perf_event_attr test for record selected CPUs exclude_user Date: Mon, 21 Aug 2023 01:27:34 +0000 Message-ID: <20230821012734.18241-8-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT In-Reply-To: <20230821012734.18241-1-yangjihong1@huawei.com> References: <20230821012734.18241-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/tests/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 = record +args = --no-bpf-event --all-kernel -C 0 kill >/dev/null 2>&1 +ret = 1 + +[event:base-record] +cpu=0 + +# no enable on exec for CPU attached +enable_on_exec=0 + +# PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | +# PERF_SAMPLE_PERIOD | PERF_SAMPLE_IDENTIFIER +# + PERF_SAMPLE_CPU added by -C 0 +sample_type=65927 + +# Dummy event handles mmaps, comm and task. +mmap=0 +comm=0 +task=0 + +# exclude_user for all-kernel option +exclude_user=1 + +[event:system-wide-dummy] + +# system_wide is not need for all (non-dummy) events have exclude_user +cpu=0 + +# exclude_user for all-kernel option +exclude_user=1 +exclude_kernel=0 -- 2.30.GIT