Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp1542100rdb; Sat, 26 Aug 2023 06:59:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3mFugu1D4F1TYHgx6++Zt6tfwWMGd+/07665phZzB9XjLkCJ2n70j5KxSlr+QWO5pSSAS X-Received: by 2002:a05:6a00:1949:b0:68b:e29c:b5c with SMTP id s9-20020a056a00194900b0068be29c0b5cmr10070296pfk.27.1693058360639; Sat, 26 Aug 2023 06:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693058360; cv=none; d=google.com; s=arc-20160816; b=jVxBfadfTKaVQvKrnrsu/BcJuqUHq+zRBkCSZWKPGF+AcK3iVcbq1bXxaXDzXe8rnv bVC90d7KHwe+s4sIdxephgmIMy50k9RcH20c0bEo77c9sgr51r0OuFhVj1/XJuhSALB1 XvgeeoCln3fkuJAS/r8JGxyM3wKFKYIZKY4KE3JHw135XUKbMvhIevgWKqIjgxYdyPyE NmADogZN1+gh4zlDmAu1+V7y/NUuDTbY72OcOIJOsAlISMiH4yPCf3HOsVlgTXFHxUIf fD4K/6mFXVEZpXKP90Xe92MKHFFuwsMJAjUUPV++VsLL/ae9V/tla8GTBHhIz4yLEJ5i Sylw== 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=+33IKwdkaJxMxtcsveCH6TMkU5DbvhbpCy21ORjQpqI=; fh=+V2NJRwYYldEteK9NYuSkp4iZMVHSlTgEsLCPEY32o0=; b=ND0ITUg9db+0QB09KW/ZH6p56andfyypDXpJXRUHc+o2TZ+/4mItoUKHarWIbiu+bW i7/Umf4IH/U06NeWLmrqfI93iGz3TnDbJ6ZDwZ5djtz5JpmH7g/Ym8G6IZveDJ8AA7ZD 5VuJHxs/vwvjf4Xym3Z/6du/2Qy+WP0rrqcp5nWKaC/OKCjQLG6Soex0U95ZOUz+DBQy QUBETPuz4m5wn5q0iUb4V9kr1ksjJ3AoqlP51sAwxRc+8LJpgDHeDL3ZsStAmpBFfU2j biiYtqpcMVCnkDYY9/TBlLuARKuZFKvQxvie1D66Lp185ZQ1GrbOvmNc6PRQUN4Zd+qU m3aw== 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 n7-20020a6543c7000000b00565454832e0si3618821pgp.190.2023.08.26.06.58.58; Sat, 26 Aug 2023 06:59:20 -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 S231772AbjHZD3t (ORCPT + 99 others); Fri, 25 Aug 2023 23:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231484AbjHZD3N (ORCPT ); Fri, 25 Aug 2023 23:29:13 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAC2F213D; Fri, 25 Aug 2023 20:29:11 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RXhzK6WSPzNmsP; Sat, 26 Aug 2023 11:25:33 +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; Sat, 26 Aug 2023 11:29:08 +0800 From: Yang Jihong To: , , , , , , , , , , , , , , , CC: Subject: [PATCH v7 6/6] perf test: Add perf_event_attr test for record selected CPUs exclude_user Date: Sat, 26 Aug 2023 03:26:08 +0000 Message-ID: <20230826032608.107261-7-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT In-Reply-To: <20230826032608.107261-1-yangjihong1@huawei.com> References: <20230826032608.107261-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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 Reviewed-by: Ian Rogers --- .../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