Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27974146rwd; Tue, 4 Jul 2023 10:34:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlHIgZmMvSGTSaxAmuo1fGF9HnDTycRj344QWLuFNDnMPyJX+cVdvZ7Rd7kpBL9VMa7avwkz X-Received: by 2002:a05:6358:9fa7:b0:134:d7c7:1176 with SMTP id fy39-20020a0563589fa700b00134d7c71176mr9974665rwb.9.1688492059698; Tue, 04 Jul 2023 10:34:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688492059; cv=none; d=google.com; s=arc-20160816; b=NbNqMuFuIu/aVbjfUrjpo6a2o0Gv+iTA1a1f38EpGkiATI3bo4dPo7q+s3EqVTpW6Z 7bME/ys74LiZmVu87Ipc+9V90ui28axT+KiL7fm91TWi1m/oJrTllN5vLtTtAiItjZw9 z32Z8g5C88888Rv+iPDAKTY7Fvoev1uP+e0a8xCI2J0uYwprm0/AdR+j8ljln3zVXO5v PvCjISznDsf3tl+v/J7QI3IXepH4XysvMVepda/WJ4BZL7jZQzWwZe90GEeZWgJ0xEQD GOsTSqhGPIFVPlF4uoivL1oj3ogrQBmx6PPV3VO11h5jftw9zFKr9AxOMePHbvbTU69p j1VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YZZgqpZksNE4Bs7ESika3g3oCcyL0AnOsQIxWBGrP+0=; fh=+1pwu69RSLRUw1F3D6kZHyYl0nEAVQMa4owKkY1NhcY=; b=dc8B78zNmCfzA2XxTe/UfAFI1gNcxIIvxQFNwYv4aSo/I7MG9AE6Yu9XZvUpMYvVn2 lSN7IojptMefcHy6cS0mq9Ng3Q6IiwJpxxB852pPTbOAeRU8pmwxG3Ql7vHX9H9ZZVzm LhdQQY3lzdvGHvq369866srr/M1hCjhsaPCgfhN/MY+bc/11S94BE8t0XF0bpDAQOuur qsdwUI7Ov+9Be712vkSNVqTeYpco3/wtnKSwh7Ps7zYMtAh5maqD0EhwMGYkyhMYBAS8 mJ4sWlFfwsG+SLxZLPWNPGLp4XhdhD4e1LwmfhDY+YwT6fHfdrmCaCI1R6pUlP3d8xhc txtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="zQ/68cLN"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020a63520d000000b0054ff8291783si21085864pgb.424.2023.07.04.10.34.07; Tue, 04 Jul 2023 10:34:19 -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=@google.com header.s=20221208 header.b="zQ/68cLN"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbjGDRKQ (ORCPT + 99 others); Tue, 4 Jul 2023 13:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231290AbjGDRKP (ORCPT ); Tue, 4 Jul 2023 13:10:15 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7751E72 for ; Tue, 4 Jul 2023 10:10:13 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-40371070eb7so187341cf.1 for ; Tue, 04 Jul 2023 10:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688490613; x=1691082613; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YZZgqpZksNE4Bs7ESika3g3oCcyL0AnOsQIxWBGrP+0=; b=zQ/68cLNfPdOGpe9SfTvHbkdFrMSA22+m5WYbQSD4UJ396k8NtDDr3p7dkm5OaBMbf vc4kMghM/N5SlP7sO4z4zF7EDp9o+xCZJoMuUeCaXMCz8iASw+gtB6v/9R8a+tg0VDJe nFRkzbUjJtxHv3kfROEpDETG7FclmO0h9XoaAKEX3+kyW2GCuRhwFS+tEiGChU0MYeCW av8boMsnCIgsl8kTsBkn2k30TmNNUX687sp0XMAyrrFJb+QsLGoegNP9vjxYg+BnPqq/ 6o5j+ZxWwd3PlnSTmqBc7svsM1D3w6QRHmCqljSHW6bB2FSr+6CiBZRSOqbDMv5BBTa2 hB+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688490613; x=1691082613; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YZZgqpZksNE4Bs7ESika3g3oCcyL0AnOsQIxWBGrP+0=; b=TDVmsbRM+qj6WfVsw+iQqrTWI35FiZelHW7aSYvmjkBsjF8coF9ntRZzU7agc6m23l g1poOXG31nV7ZYXpAbLkAqvXQPx48OOH/vAOF0YD0OPmbicCNSY8kKw3ASOzSbJAZmA8 gdvx/69/eVD47z4OuZf8Um0gT65yp3jkBamQunAA+WQdCZe7HAetp7FWkDDBp1pOXtd5 jjrlGoISfOpfX/TwMRw/wVjPNpIm1kWqt2PpepfWUOiP4gGnCUma6Vv0/I9JUgRCuumI L0fz5gOoh8h8WTKO1gtR1Dp3zAUB9KQ0TTCBw6ngOq0XYJG66+RbG/1HQROHMdtylSxv z/NQ== X-Gm-Message-State: ABy/qLZvJoaU1BGcwCRuQKnp0b8lbbyeEIL02HHrPcOK0hg+RWkWX3V7 2pBUqQ2ZlRopZetQ85d6LM+43lmlNVLA66e5C35wLg== X-Received: by 2002:ac8:5908:0:b0:3f8:3065:7fc5 with SMTP id 8-20020ac85908000000b003f830657fc5mr126181qty.1.1688490612831; Tue, 04 Jul 2023 10:10:12 -0700 (PDT) MIME-Version: 1.0 References: <20230704143628.1177124-1-james.clark@arm.com> In-Reply-To: <20230704143628.1177124-1-james.clark@arm.com> From: Ian Rogers Date: Tue, 4 Jul 2023 10:10:00 -0700 Message-ID: Subject: Re: [PATCH 1/2] perf test: Fix event parsing test on Arm To: James Clark Cc: linux-perf-users@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Tue, Jul 4, 2023 at 7:38=E2=80=AFAM James Clark wr= ote: > > The test looks for a PMU from sysfs with type =3D 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 Acked-by: Ian Rogers Thanks, Ian > --- > 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-eve= nts.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 *evli= st) > TEST_ASSERT_VAL("wrong number of entries", 0 !=3D evlist->core.nr= _entries); > > perf_evlist__for_each_evsel(&evlist->core, evsel) { > - struct perf_pmu *pmu =3D NULL; > + struct perf_pmu *pmu __maybe_unused =3D NULL; > bool type_matched =3D false; > > TEST_ASSERT_VAL("wrong config", test_perf_config(evsel, 0= x1a)); > + TEST_ASSERT_VAL("event not parsed as raw type", > + evsel->attr.type =3D=3D 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 P= MU > + * so no need to test for a matching type here. > + */ > + type_matched =3D raw_type_match =3D true; > +#else > while ((pmu =3D perf_pmus__scan(pmu)) !=3D NULL) { > if (pmu->type =3D=3D 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 =3D 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 >