Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28746080rwd; Wed, 5 Jul 2023 01:59:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlF1Db9KvtmmxN2Ux2MHRKeh+IYbP0VUOxIO0nT1kBdaj2hBtasyDRh3hHF3+LQf1K06/c6/ X-Received: by 2002:a92:c806:0:b0:345:c8cf:6049 with SMTP id v6-20020a92c806000000b00345c8cf6049mr13912181iln.16.1688547586157; Wed, 05 Jul 2023 01:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688547586; cv=none; d=google.com; s=arc-20160816; b=WC4zALygQQ486gE7bJr8Cb2Q9b7qSHuGmXd/nBl0TsHQVcFqm4CPGDl6OAmN8u2mSR yTjC0FJm/0MRUCuAgD0umXuVGvSc5upc6EcEZ3U2Y0z9Cm9tKQq2OwQott81Xer0Ix/F xdY4LCJpPvsoSfa9DR2hGwwGrU0SFuVNKN9XF6/DliQZeDKnUHQ6goAC+2Ur4M4tia15 XJAkfvBtAY8FRCrScGJ7DZ2veE9YzmQWQQ41x+msiuEA6CJhomEUxZYyIwfNM+eAWXs3 boYU888rU/cfziTk82udObEWukyxTToUawJcaQ/Yjtc0O/PExyKDKGPCQ83uUmIVelgl uM2Q== 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=K0A8lIXyhbMF0UX5MAQmj39tZwR+jIeo3Y/PfMhIRAw=; fh=6G11ZSykRjVXDT3BTDtd54gDGeUvSLvr1tuSgrs7/vQ=; b=JGF8kRLYnCzfiXgeX76Xrh676KZTJIqER4IQxweyzK7LJ19Bfo2ANZNNUg1YxM4AK9 Ncx4cUM8hwkkTSP9CCHxEw25IhBKji9JF2pV9JN+vjLGPS9lreUWzRWBSYkfgfSZR4Ob 0m2zy7j34qqDbwD+WuVFJYJQwEuqOYzE6LHt5wC1KXAcCrm49hu9r0VaOwUQkqbj5nHs arE0fYNBvEchU6rkK1CCLsuRB5Ff1z5NzFrjJLoVD04Nb0e3L9ykntImU7GONHTYDSgo X5xm4M5FfkNqK/FHBGZWVk/MDpax+kSGeIqiPagLiyNTc9aIjg+YrWDfsNAHbAO3tyh0 2QYg== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g3-20020a63e603000000b0054ff425ab2csi21977464pgh.234.2023.07.05.01.59.31; Wed, 05 Jul 2023 01:59:46 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbjGEI1R (ORCPT + 99 others); Wed, 5 Jul 2023 04:27:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232056AbjGEI1J (ORCPT ); Wed, 5 Jul 2023 04:27:09 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D63E5184; Wed, 5 Jul 2023 01:27:05 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EFA6E169C; Wed, 5 Jul 2023 01:27:47 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EC4D73F73F; Wed, 5 Jul 2023 01:27:03 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] perf test: Fix event parsing test on Arm Date: Wed, 5 Jul 2023 09:26:51 +0100 Message-Id: <20230705082653.23566-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230705082653.23566-1-james.clark@arm.com> References: <20230705082653.23566-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 The test looks for a PMU from sysfs with type = PERF_TYPE_RAW when opening a raw event. Arm doesn't have a real raw PMU, only core PMUs with unique types other than raw. Instead of looking for a matching PMU, just test that the event type was parsed as raw and skip the PMU search on Arm. The raw event type test should also apply to all platforms so add it outside of the ifdef. Fixes: aefde50a446b ("perf test: Fix parse-events tests for >1 core PMU") Acked-by: Ian Rogers Signed-off-by: James Clark --- tools/perf/tests/parse-events.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 133218e51ab4..21f79aa31233 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -108,10 +108,21 @@ static int test__checkevent_raw(struct evlist *evlist) TEST_ASSERT_VAL("wrong number of entries", 0 != evlist->core.nr_entries); perf_evlist__for_each_evsel(&evlist->core, evsel) { - struct perf_pmu *pmu = NULL; + struct perf_pmu *pmu __maybe_unused = NULL; bool type_matched = false; TEST_ASSERT_VAL("wrong config", test_perf_config(evsel, 0x1a)); + TEST_ASSERT_VAL("event not parsed as raw type", + evsel->attr.type == PERF_TYPE_RAW); +#if defined(__aarch64__) + /* + * Arm doesn't have a real raw type PMU in sysfs, so raw events + * would never match any PMU. However, RAW events on Arm will + * always successfully open on the first available core PMU + * so no need to test for a matching type here. + */ + type_matched = raw_type_match = true; +#else while ((pmu = perf_pmus__scan(pmu)) != NULL) { if (pmu->type == evsel->attr.type) { TEST_ASSERT_VAL("PMU type expected once", !type_matched); @@ -120,6 +131,7 @@ static int test__checkevent_raw(struct evlist *evlist) raw_type_match = true; } } +#endif TEST_ASSERT_VAL("No PMU found for type", type_matched); } TEST_ASSERT_VAL("Raw PMU not matched", raw_type_match); -- 2.34.1