Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27804480rwd; Tue, 4 Jul 2023 08:05:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlFNhTsb6zdNSFjbmEpxUD4yaUz08csHfi3/46Sim5RhXu4LykIkVO1RuZy1uJaepFQWaEsm X-Received: by 2002:a05:6a00:15c9:b0:682:4c1c:a0f6 with SMTP id o9-20020a056a0015c900b006824c1ca0f6mr18026176pfu.3.1688483150912; Tue, 04 Jul 2023 08:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688483150; cv=none; d=google.com; s=arc-20160816; b=s1EecAVKHLzTGFZPK0ImT/orkEx29Kvyhubd06NvIpVyqfTF8YKf4Y2yxeyxt6G64p 6xcb1LI/8tmfZdfjPda2tVVLk04k1vEh0/xDdh9PFHgz+3MyVOz440i7tG3ap5PifaBH YnUAEO2beTVnEPUWglv17Nj/qTpvhrLC9+dUc8GVWCRxBZZjV9jNYKU21d4dIJwt8R8D iXx4kNbL8ctBChq6Q/fz9DCeEU6NnBNIX5D4tyikImjCWi9O48Ne8fSus1faC4hJzHHd xFxzN00ordRnr8+uWObnI7P8kNXTsduTvnInnTCCiy4/kw+N9RmMT9u66TqnNMGZ+T9W bFEA== 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 :message-id:date:subject:cc:to:from; bh=GZ4opaWQUziqzhRukaWmpcM+dqWwfpfJIPewLcWibMA=; fh=6G11ZSykRjVXDT3BTDtd54gDGeUvSLvr1tuSgrs7/vQ=; b=weaF4MNtATU/BcxdtcjduYM2hLshlnSGS/ID62Nts17rpNiaf1l4Q9cN720eM0kdYo NPPZsZFYOXtmu+9o8GsIz6SfJMElEm8sAT1YFLuT35Fu/pYeYVLl/tP38n/QDb0vmmr8 su54/IwEWsMm7ZEjy6mAgnL/ig0fUwncMplECZytjduOJxY0aUKIQ5GgnkE/KpMhZq8o d9eeE1yBU28v1kDL9sCM5raGHK8KdaA7sZxyoSvmG5k4pmyvFzQVWmabn+6wdsbRT5xG 5MgJ4bOtUMTGweJK+vMkSNFLsGTyLtuUrH2Sqwoe4vfAZPlLmXYjO5Dv9ZWUKvSR5wcI V/zQ== 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 f6-20020a631f06000000b0054fcdcbf4a3si21218655pgf.142.2023.07.04.08.05.33; Tue, 04 Jul 2023 08:05:50 -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 S231340AbjGDOiN (ORCPT + 99 others); Tue, 4 Jul 2023 10:38:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231528AbjGDOiM (ORCPT ); Tue, 4 Jul 2023 10:38:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3F21610D2; Tue, 4 Jul 2023 07:38:11 -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 71ED4152B; Tue, 4 Jul 2023 07:38:53 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 44E6E3F73F; Tue, 4 Jul 2023 07:38:09 -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 1/2] perf test: Fix event parsing test on Arm Date: Tue, 4 Jul 2023 15:36:27 +0100 Message-Id: <20230704143628.1177124-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 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") 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