Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1122584rwr; Thu, 27 Apr 2023 12:39:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7H6cD9SxhxR7shuArkkvwnJ6wTZFNyN9/bW4Nn+dD0GXcGccDXmhWZujD3pnoAwENRoUP6 X-Received: by 2002:a05:6a20:a5a8:b0:f6:d4d:2d with SMTP id bc40-20020a056a20a5a800b000f60d4d002dmr2814591pzb.31.1682624393940; Thu, 27 Apr 2023 12:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682624393; cv=none; d=google.com; s=arc-20160816; b=iif3SbBZUH+v0regWgX6VejVHRIv4q2OqIxs8h1QdLyXMcL5IZxqq8A4Y/4VANTPRT gKxXuOiXhpQUdbxxtYtLNmvS2m8oYK7jn2ZseJFidYc06C9C4/de9wVvtTtHev1T0Oqv 5CS7YzQJ1a53o+YGqpUr8qiDU1MyUZiD/BdanMiuErxY4Rnrkgf/GDKyrwsDPADPVXq4 3PQtsPSFNfyGRdKf2YG89h814q3POFrjbiHwhgA4ZZXkMtkjfyQkTQ/oSxIp6w2WE1Sv Rudb7xgWyAqFFXbIPbDw9k3OqkUFGT2ixXlCE3NF2/meA1P2yIb2R9CyU7wnJMdLqYmb fF7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=xiuPYd/E1nfSDx0xk9WyGJh4QwvYbwUGbUJh/oyIR7E=; b=lv8bfM6dmhJIMd45RiGQlgq86IxWIe9cUOjZKAgcR9kKBS2ck6q1NPhOmVhuE2dvm7 odouGmJ2bNvsnZT3b05IpoM8qfLLP17vcB91+mXktDJogelDDv009IsqGp4q0yiflIYf 75Xv9O79RLmK5YS4kyoKCQU5sTKUxHharBlQWoTxy4SoUoOYMMzcwfpWQzZKIOFpVuNf pi75/xfUgw0cZGzHd1OcxYntAty1CS4HdxzH1vjrL7CgjeX31Uy29hCePqebvhi5tkVH ScuMDqKcR7jSvZi1QaX/fF9PxCffzBznmdUkNAew72JWEkWRITw7hPML31bRfJdq/bwt a5HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Q0Yrdtb5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u202-20020a6279d3000000b0062dd1d1c48csi20486458pfc.377.2023.04.27.12.39.39; Thu, 27 Apr 2023 12:39:53 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=Q0Yrdtb5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343660AbjD0Tjg (ORCPT + 99 others); Thu, 27 Apr 2023 15:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343655AbjD0Tjf (ORCPT ); Thu, 27 Apr 2023 15:39:35 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F0D5213A; Thu, 27 Apr 2023 12:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682624374; x=1714160374; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=cY4rH7P8iY/+1ilBU7ExpezMXhmPsPrS0cJpUe7NWUE=; b=Q0Yrdtb51qcxHgXTyGCEL13mwhdtIPa36GiQUi//5ALQwHQOR9t5Cm2W bm7hxwYHEEO6+PBMQh80r/VHowg5qAlTysF/uMzsMCXIb60EFbE7OEq2o zhATplppT65TiDBnJm64BY1rE/R2UPy8O7w4M7dcGXqJJrlnU60UDqt6t WqFddN7Tiv2bJUVMpz2mIZiTf4lC7HjwiyLfSBnLldFfoaaXJj0FXSCee xkht+i7sK/mTsBEXHsl0+HcyfGFziU62xAUkUS2wncVcN8iKKzzWI7pVw n43n+XLxFzAOIIlQr0WPUxZpx16FDgYWlQ8WeYyqdTT33BWBb2GIT7dVv A==; X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="375534711" X-IronPort-AV: E=Sophos;i="5.99,232,1677571200"; d="scan'208";a="375534711" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2023 12:39:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="644821280" X-IronPort-AV: E=Sophos;i="5.99,232,1677571200"; d="scan'208";a="644821280" Received: from linux.intel.com ([10.54.29.200]) by orsmga003.jf.intel.com with ESMTP; 27 Apr 2023 12:39:32 -0700 Received: from [10.209.41.222] (kliang2-mobl1.ccr.corp.intel.com [10.209.41.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 04AC6580377; Thu, 27 Apr 2023 12:39:28 -0700 (PDT) Message-ID: <496640a2-368d-aaa1-b678-50f65df7d74c@linux.intel.com> Date: Thu, 27 Apr 2023 15:39:27 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v1 09/40] perf test: Use valid for PMU tests Content-Language: en-US To: Ian Rogers , Arnaldo Carvalho de Melo , Ahmad Yasin , Peter Zijlstra , Ingo Molnar , Stephane Eranian , Andi Kleen , Perry Taylor , Samantha Alt , Caleb Biggers , Weilin Wang , Edward Baker , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Florian Fischer , Rob Herring , Zhengjun Xing , John Garry , Kajol Jain , Sumanth Korikkar , Thomas Richter , Tiezhu Yang , Ravi Bangoria , Leo Yan , Yang Jihong , James Clark , Suzuki Poulouse , Kang Minchul , Athira Rajeev , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230426070050.1315519-1-irogers@google.com> <20230426070050.1315519-10-irogers@google.com> From: "Liang, Kan" In-Reply-To: <20230426070050.1315519-10-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-04-26 3:00 a.m., Ian Rogers wrote: > Rather than skip all tests in test__events_pmu if PMU cpu isn't > present, use the per-test valid test. This allows the running of > software PMU tests on hybrid and arm systems. > > Signed-off-by: Ian Rogers Run the test on Cascade Lake and Alder Lake. It looks good. Tested-by: Kan Liang Thanks, Kan > --- > tools/perf/tests/parse-events.c | 27 +++++++++------------------ > 1 file changed, 9 insertions(+), 18 deletions(-) > > diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c > index 385bbbc4a409..08d6b8a3015d 100644 > --- a/tools/perf/tests/parse-events.c > +++ b/tools/perf/tests/parse-events.c > @@ -1430,6 +1430,11 @@ static int test__checkevent_config_cache(struct evlist *evlist) > return TEST_OK; > } > > +static bool test__pmu_cpu_valid(void) > +{ > + return !!perf_pmu__find("cpu"); > +} > + > static bool test__intel_pt_valid(void) > { > return !!perf_pmu__find("intel_pt"); > @@ -1979,21 +1984,25 @@ static const struct evlist_test test__events[] = { > static const struct evlist_test test__events_pmu[] = { > { > .name = "cpu/config=10,config1,config2=3,period=1000/u", > + .valid = test__pmu_cpu_valid, > .check = test__checkevent_pmu, > /* 0 */ > }, > { > .name = "cpu/config=1,name=krava/u,cpu/config=2/u", > + .valid = test__pmu_cpu_valid, > .check = test__checkevent_pmu_name, > /* 1 */ > }, > { > .name = "cpu/config=1,call-graph=fp,time,period=100000/,cpu/config=2,call-graph=no,time=0,period=2000/", > + .valid = test__pmu_cpu_valid, > .check = test__checkevent_pmu_partial_time_callgraph, > /* 2 */ > }, > { > .name = "cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2/ukp", > + .valid = test__pmu_cpu_valid, > .check = test__checkevent_complex_name, > /* 3 */ > }, > @@ -2209,21 +2218,6 @@ static int test__terms2(struct test_suite *test __maybe_unused, int subtest __ma > return test_terms(test__terms, ARRAY_SIZE(test__terms)); > } > > -static int test_pmu(void) > -{ > - struct stat st; > - char path[PATH_MAX]; > - int ret; > - > - snprintf(path, PATH_MAX, "%s/bus/event_source/devices/cpu/format/", > - sysfs__mountpoint()); > - > - ret = stat(path, &st); > - if (ret) > - pr_debug("omitting PMU cpu tests\n"); > - return !ret; > -} > - > static int test__pmu_events(struct test_suite *test __maybe_unused, int subtest __maybe_unused) > { > struct perf_pmu *pmu; > @@ -2305,9 +2299,6 @@ static int test__pmu_events(struct test_suite *test __maybe_unused, int subtest > > static int test__pmu_events2(struct test_suite *test __maybe_unused, int subtest __maybe_unused) > { > - if (!test_pmu()) > - return TEST_SKIP; > - > return test_events(test__events_pmu, ARRAY_SIZE(test__events_pmu)); > } >