Message ID | 20230804020741.99806-8-yangjihong1@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp1527652vqx; Thu, 3 Aug 2023 19:13:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFXUtAjxwmekYhz3vZFr+8pFXpnpNsUBC2EpSj8JFa7dcNYnrcuFojb5jQG6PWcVCl7X4YG X-Received: by 2002:a05:6402:430b:b0:521:66b4:13b4 with SMTP id m11-20020a056402430b00b0052166b413b4mr16898727edc.0.1691115214871; Thu, 03 Aug 2023 19:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691115214; cv=none; d=google.com; s=arc-20160816; b=ESenwT7jmsFQVaIEM6C7/SI3oqw+MkCMNgPWcniuC8xTkS63ZFR9QMvNfKF+jcVaUX TXFFFqov0A9aHGb/k2jLJhhBEi8c0l571JNMyRuyX5oFEX0x/YCLoKCDgfoDBdqWp14+ aXLabp0zmGvoQs8/ZRj1IPC70R35upx8Ym0hzKyWwZfqy+HptYq9FuzY9RnC1Ov5LrDc hnj4AQDuWQegufvyRr6tE37AURo6s+c6aarvpbqddtaa3ACqfoiX6xoHiMsbfjB2i6Qt h8R9hIDyDCUPoCA9jI8bu8G6HP6m+EItsGmxstp+OauZUVJuaIB1JiO3wtLRYNwWhoFU +heg== 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=RnrXaza/mNjAZ2eJiW1Z9i32eoiXz6WN7DCQbefeO70=; fh=Ib1wi7jRbo+eNDLEErvWCJx+cnUm87PkGFthhdFf08Y=; b=guu0DBl4ABF+/EutkAzbHCYaCZ0mNIz1SbYgEhFf8OHcLyfXT0qeHigNvil4dw22LA 3kOXCPzjtXrx7ej1yUeE/QL2xvf7VQhCubmcpaQyuAU+pyBVPOshpJzsaEgm01HA+2tC p3yGSjToSA6HdgnmYikGqNUrpUYlZWeiGSW9YnPA8AkN78FK4z2hzQ1Vlvi5/nXKB9gz ZmIBoIr2w1lJ7sNYFybt8pB1YDr0Wn1BrLQdQiOxbLA6tjqv4QAIy/pP5kd0T/c9+rsn 5nk94g/4JS+focF6lt9qTS3TCYIBZifivdM5wk5rMbgGCp2AgXWO8SlWX+EUxmcROP4P ixyw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j16-20020aa7ca50000000b0051e04ea21ebsi796670edt.202.2023.08.03.19.13.10; Thu, 03 Aug 2023 19:13:34 -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 S233157AbjHDCKs (ORCPT <rfc822;tertiaryakionsight@gmail.com> + 99 others); Thu, 3 Aug 2023 22:10:48 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <yangjihong1@huawei.com> To: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>, <mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>, <jolsa@kernel.org>, <namhyung@kernel.org>, <irogers@google.com>, <adrian.hunter@intel.com>, <kan.liang@linux.intel.com>, <james.clark@arm.com>, <tmricht@linux.ibm.com>, <ak@linux.intel.com>, <anshuman.khandual@arm.com>, <linux-kernel@vger.kernel.org>, <linux-perf-users@vger.kernel.org> CC: <yangjihong1@huawei.com> 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: 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773262827929649150 X-GMAIL-MSGID: 1773262827929649150 |
Series |
perf record: Track sideband events for all CPUs when tracing selected CPUs
|
|
Commit Message
Yang Jihong
Aug. 4, 2023, 2:07 a.m. UTC
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
<SNIP>
running './tests/attr/test-record-C0-all-kernel'
<SNIP>
test child finished with 0
---- end ----
Setup struct perf_event_attr: Ok
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
---
.../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
Comments
On 4/08/23 05:07, Yang Jihong wrote: > 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 > <SNIP> > running './tests/attr/test-record-C0-all-kernel' > <SNIP> > test child finished with 0 > ---- end ---- > Setup struct perf_event_attr: Ok > > Signed-off-by: Yang Jihong <yangjihong1@huawei.com> Tested-by: Adrian Hunter <adrian.hunter@intel.com> > --- > .../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
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