From nobody Sun May 10 09:54:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53441C433F5 for ; Fri, 13 May 2022 04:05:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376948AbiEMEFj (ORCPT ); Fri, 13 May 2022 00:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376928AbiEMEFb (ORCPT ); Fri, 13 May 2022 00:05:31 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B30C529B01E for ; Thu, 12 May 2022 21:05:28 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id b6-20020a5b0b46000000b006457d921729so6252611ybr.23 for ; Thu, 12 May 2022 21:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=eQLC4xvJjx0IxiV0N/NcBewb/ng8rVX8YxuFDVrzqJ4=; b=XH9POhPcsHh4jg4xxmYN8TGVRB/U7SkOA3DVDNu8P65CflDZqAA7Y+crfFelRDSjJD SpPa7TZMucTLUXd80n0haYz8edAh5pZOJHGfDq4a2u6Cy6RL1lYDgN/pUkD827TAyWwv pL/Z39Ifo7YgGaqxWGuHtCCbO5oRsiDGXTcHa/sxPFTAcbntiJxqcTd37hqdT53tdS7v S96OdTM3CKeG341lz3+Ff33aDILA8kLpUhgV+4unE7cZaBynbHDrGxGLDl1xSkfWgZAJ 5v4o/k1WOVkQ1WJsuBFdby2ThuixYWMGLSlHPifYxZBy+f5Dbdcsv3a68oKZra9JnMWS cwfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=eQLC4xvJjx0IxiV0N/NcBewb/ng8rVX8YxuFDVrzqJ4=; b=jOr5GhNoIB0mcNlqKPqyLXn+2UlNSqsm5i090E5kHfNsURtDG8vnnOKjWZ/Hj1boDg Pb2ChhlWFEYzMyhW9ziJHL77WS8L4GwZeHuyZUQljTl0NpzDEM1ca1egm0Zo9vVsN2Ox Q096GD3vOlTpAQwB+lO7Dn2THt+qppBx7pjtprzBm8V5zKfkZVNWucchJndILMPdfZ8/ uWOu3hMYOqpq4X2atenaVXofykdzpR9Y7u9CImtGznbP6yf0YBheQ1YTM6KLMhiqDcfS ObqkMVSgFwfm9J70rQ/TT7L1qdD+m1xxNhnEKrbvGwlm+pQQTnRxINvveoD2bTmHNpgF Yqtg== X-Gm-Message-State: AOAM5324Ey+lVNGFFtwvI590K3OiH5IBp2VsRuxVcEJHtMIB4TTyLzMN tJO+MmgJeemBIIMXs2l2Q5OtRgrlUupd X-Google-Smtp-Source: ABdhPJzyGskPGkpPISS9h8ZWQklnv7XS0yI+qMgu8OSSe6Pf2ExA8jQP6cgqgcYEZ70BN0ziUPOhyo4wrv9b X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:9b61:c91f:ca29:ae54]) (user=irogers job=sendgmr) by 2002:a81:23d8:0:b0:2f8:be91:f46f with SMTP id j207-20020a8123d8000000b002f8be91f46fmr3701717ywj.131.1652414727907; Thu, 12 May 2022 21:05:27 -0700 (PDT) Date: Thu, 12 May 2022 21:05:13 -0700 In-Reply-To: <20220513040519.1499333-1-irogers@google.com> Message-Id: <20220513040519.1499333-2-irogers@google.com> Mime-Version: 1.0 References: <20220513040519.1499333-1-irogers@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH 1/7] perf test: Skip reason for suites with 1 test From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Riccardo Mancini , Sohaib Mohamed , Carsten Haitzler , Marco Elver , John Garry , Michael Petlan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When a suite has just 1 subtest, the subtest number is given as -1 to avoid indented printing. When this subtest number is seen for the skip reason, use the reason of the first test. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Reviewed-by: John Garry --- tools/perf/tests/builtin-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-tes= t.c index fac3717d9ba1..33fcafa0fa79 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -137,10 +137,10 @@ static bool has_subtests(const struct test_suite *t) =20 static const char *skip_reason(const struct test_suite *t, int subtest) { - if (t->test_cases && subtest >=3D 0) - return t->test_cases[subtest].skip_reason; + if (!t->test_cases) + return NULL; =20 - return NULL; + return t->test_cases[subtest >=3D 0 ? subtest : 0].skip_reason; } =20 static const char *test_description(const struct test_suite *t, int subtes= t) --=20 2.36.0.550.gb090851708-goog From nobody Sun May 10 09:54:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34D74C433F5 for ; Fri, 13 May 2022 04:05:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376938AbiEMEFq (ORCPT ); Fri, 13 May 2022 00:05:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376930AbiEMEFc (ORCPT ); Fri, 13 May 2022 00:05:32 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D87D29B025 for ; Thu, 12 May 2022 21:05:30 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2d7eaa730d9so62510687b3.13 for ; Thu, 12 May 2022 21:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=20i4c1kc+enHNe40Ax5Yg1Hwx6kxN38xUQQ6orKgm5M=; b=QpsfvaFVhUgzwxz9VTeCun1CQpi20aeZleVBr7p+5qnaq/zf0ooX26/68S/OwE8Cn/ mI/kdQQAHxlMKD7IZhg5dFosbsXW24XDN60pyUkgxMBMPPikOvyg3T1JpMv2NG9+es61 Il0duHkhcZeKyHO2nkr/ahOkjkynFMrnCtdzMnhZI5ogSepB6WVAvIyzoZFezhPTv1um MzvWxcViOPPWXZlZe2Runzadv/0iOnvUUJF/VO0Ch2FPWxAMEAlCHQ3Tj4qEGa0gCtYY jfga3HRFjDuYxPurA7RE2bu3Xd/JdHs3W/em/dT8ttKhNg6VXBaWK0/iISVqpPoNraNw YrMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=20i4c1kc+enHNe40Ax5Yg1Hwx6kxN38xUQQ6orKgm5M=; b=f5cayi014KhJxqGySP+uhuWvz7GIHQdusUqqXluGRzl2dpVB8fYBu6JlDgPuJ+rOKA pWIq1a90bF5gAmgf4qZJU0T6TLavSbOdcVmqbz3bb82krMDCQ2kZFJbjYSCUtvqoJg3L kqrKs7/WMEtYlM24rFKau4cLsbEXVqwXpxNxva6rmS4Pa0WqL9K1C05Gm31m7oZWKar8 lFQidOnUfHOKfwG+qdr/4uXTCegGkYWgLBZYW1CIwDtuUMRde/UWg1wYH2ltrdp9j/wv nTBynb3Ri5oB8D8Ypkdg8taefWraYcRoyPYzbMAIMSWWElTJWp8kEFMCLp1hAsL6UkzG YVGQ== X-Gm-Message-State: AOAM532EDYhB3ggT+nsdTQ4iUqiRBeh5eoEJLGyMys9y3MeUBzC37j0n kuwMaIEJ+LTpzMwDITenOegUGwruwSMy X-Google-Smtp-Source: ABdhPJwaZZfSOmopDsuZd6+bJPH9rtKQAR3lvKZfNgkt+4z4fWX387Ba3M8Eb6MMf0/bEJH5wKU7LPpfgxhY X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:9b61:c91f:ca29:ae54]) (user=irogers job=sendgmr) by 2002:a81:24d2:0:b0:2f7:b684:de49 with SMTP id k201-20020a8124d2000000b002f7b684de49mr3552435ywk.310.1652414729894; Thu, 12 May 2022 21:05:29 -0700 (PDT) Date: Thu, 12 May 2022 21:05:14 -0700 In-Reply-To: <20220513040519.1499333-1-irogers@google.com> Message-Id: <20220513040519.1499333-3-irogers@google.com> Mime-Version: 1.0 References: <20220513040519.1499333-1-irogers@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH 2/7] perf test: Use skip in vmlinux kallsyms From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Riccardo Mancini , Sohaib Mohamed , Carsten Haitzler , Marco Elver , John Garry , Michael Petlan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently failures in reading vmlinux or kallsyms result in a test failure. However, the failure is typically permission related. Prefer to flag these failures as skip. Signed-off-by: Ian Rogers --- tools/perf/tests/vmlinux-kallsyms.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux= -kallsyms.c index 93dee542a177..983f32964749 100644 --- a/tools/perf/tests/vmlinux-kallsyms.c +++ b/tools/perf/tests/vmlinux-kallsyms.c @@ -114,7 +114,7 @@ static bool is_ignored_symbol(const char *name, char ty= pe) static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_= unused, int subtest __maybe_unused) { - int err =3D -1; + int err =3D TEST_FAIL; struct rb_node *nd; struct symbol *sym; struct map *kallsyms_map, *vmlinux_map, *map; @@ -142,7 +142,8 @@ static int test__vmlinux_matches_kallsyms(struct test_s= uite *test __maybe_unused * and find the .ko files that match them in /lib/modules/`uname -r`/. */ if (machine__create_kernel_maps(&kallsyms) < 0) { - pr_debug("machine__create_kernel_maps "); + pr_info("machine__create_kernel_maps failed"); + err =3D TEST_SKIP; goto out; } =20 @@ -158,7 +159,8 @@ static int test__vmlinux_matches_kallsyms(struct test_s= uite *test __maybe_unused * code and with the one got from /proc/modules from the "kallsyms" code. */ if (machine__load_kallsyms(&kallsyms, "/proc/kallsyms") <=3D 0) { - pr_debug("dso__load_kallsyms "); + pr_debug("machine__load_kallsyms failed"); + err =3D TEST_SKIP; goto out; } =20 @@ -178,7 +180,7 @@ static int test__vmlinux_matches_kallsyms(struct test_s= uite *test __maybe_unused * Now repeat step 2, this time for the vmlinux file we'll auto-locate. */ if (machine__create_kernel_maps(&vmlinux) < 0) { - pr_debug("machine__create_kernel_maps "); + pr_info("machine__create_kernel_maps failed"); goto out; } =20 @@ -196,7 +198,7 @@ static int test__vmlinux_matches_kallsyms(struct test_s= uite *test __maybe_unused * to fixup the symbols. */ if (machine__load_vmlinux_path(&vmlinux) <=3D 0) { - pr_debug("Couldn't find a vmlinux that matches the kernel running on thi= s machine, skipping test\n"); + pr_info("Couldn't find a vmlinux that matches the kernel running on this= machine, skipping test\n"); err =3D TEST_SKIP; goto out; } --=20 2.36.0.550.gb090851708-goog From nobody Sun May 10 09:54:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1321C433EF for ; Fri, 13 May 2022 04:05:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376966AbiEMEFv (ORCPT ); Fri, 13 May 2022 00:05:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376937AbiEMEFe (ORCPT ); Fri, 13 May 2022 00:05:34 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB22A29B01D for ; Thu, 12 May 2022 21:05:32 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2f7dbceab08so62002517b3.10 for ; Thu, 12 May 2022 21:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=y38KhyrUQduygK/6m8o41nq8hRxktYPzYp+6Ci4BGNw=; b=MMHzHE5AMRTEoZKQFFOfqBhipa0tAahXZSq1c17O/neM2QN1ModjUO/jbdK6Kw2kNY XAwaVpLcNBHz8ffWDBGML2zsdZh7hDjDxOM7IggAREf/9kYMdCr0iFv7L5Bc4nVocTwK GbLpnxkZDn2fI7Fyb/H42XKOIvz99ML+Q24efTp/FGRSpcQHW+ApbIMFeBDUXS5DMYPQ vofSGI4ADilMBy2jW2pqTKcx37E5SpBfKupJbhAb4F1kKD69URsN8mWn8nWSlYp7kM5Z 2+eKrp2jQ230Q1m59eBshd7XHRquqbozN9lxSWtGS/kCYCadC3NGoSCNqm1G9wDret1b U1EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=y38KhyrUQduygK/6m8o41nq8hRxktYPzYp+6Ci4BGNw=; b=Q0ygbsN3TTkdTzIOB6m44GF8sIhVKc07bwNYs8Vwr5EHwwX2PgGNLyijxRaF1/GXjI UdJOHJ9hCpVxq7igoYCS/5L2IrBa+XSgUn+xsTu1fTlIcOPlZ283EzJjArt9d2eIyE6J WKcsmSzUWGvKGkNsu2+oZsQRIhtwp1kQnnP8Meu/XNOdnTmHKiKrYxR1m66akQjilEZk 8399o0bEiMTxh9+xmrW2vnpZ83Ncy61Ogw12QhFkJ0Lr4mQS+wtucXJsJljNNk6+K0rC vpgj9CcgzljpqfkVqfWx4yFPHhSgaS7SSJuBUpKatQsrfvHK9nY2ZisRL1s4lB6N7PDs qT3Q== X-Gm-Message-State: AOAM532MTwHvJvroV9BvfK8Ui6UHinqFfey+OZ5G5XprI7lyLrAx2tIp kRM/4khS8D29PLL+VjBYcI1cQhFwO60M X-Google-Smtp-Source: ABdhPJxPLWUbZ2LL8m5tupWWnw1bCuSxMt1M1UDnB9MkClL6TMY0wMhL+HZqu1MVhozBcWXPsjPxUKELk+4r X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:9b61:c91f:ca29:ae54]) (user=irogers job=sendgmr) by 2002:a25:d90c:0:b0:648:dbec:5391 with SMTP id q12-20020a25d90c000000b00648dbec5391mr3078089ybg.309.1652414731949; Thu, 12 May 2022 21:05:31 -0700 (PDT) Date: Thu, 12 May 2022 21:05:15 -0700 In-Reply-To: <20220513040519.1499333-1-irogers@google.com> Message-Id: <20220513040519.1499333-4-irogers@google.com> Mime-Version: 1.0 References: <20220513040519.1499333-1-irogers@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH 3/7] perf test: Use skip in openat syscall From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Riccardo Mancini , Sohaib Mohamed , Carsten Haitzler , Marco Elver , John Garry , Michael Petlan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Failures to open the tracepoint cause this test to fail, however, typically such failures are permission related. Lower the failure to just skipping the test in those cases and add a skip reason. Signed-off-by: Ian Rogers --- tools/perf/tests/openat-syscall-all-cpus.c | 23 +++++++++++++++++----- tools/perf/tests/openat-syscall.c | 20 +++++++++++++++---- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/= openat-syscall-all-cpus.c index 1ab362323d25..90828ae03ef5 100644 --- a/tools/perf/tests/openat-syscall-all-cpus.c +++ b/tools/perf/tests/openat-syscall-all-cpus.c @@ -22,7 +22,7 @@ static int test__openat_syscall_event_on_all_cpus(struct test_suite *test = __maybe_unused, int subtest __maybe_unused) { - int err =3D -1, fd, idx; + int err =3D TEST_FAIL, fd, idx; struct perf_cpu cpu; struct perf_cpu_map *cpus; struct evsel *evsel; @@ -49,6 +49,7 @@ static int test__openat_syscall_event_on_all_cpus(struct = test_suite *test __mayb if (IS_ERR(evsel)) { tracing_path__strerror_open_tp(errno, errbuf, sizeof(errbuf), "syscalls"= , "sys_enter_openat"); pr_debug("%s\n", errbuf); + err =3D TEST_SKIP; goto out_cpu_map_delete; } =20 @@ -56,6 +57,7 @@ static int test__openat_syscall_event_on_all_cpus(struct = test_suite *test __mayb pr_debug("failed to open counter: %s, " "tweak /proc/sys/kernel/perf_event_paranoid?\n", str_error_r(errno, sbuf, sizeof(sbuf))); + err =3D TEST_SKIP; goto out_evsel_delete; } =20 @@ -88,7 +90,7 @@ static int test__openat_syscall_event_on_all_cpus(struct = test_suite *test __mayb =20 evsel->core.cpus =3D perf_cpu_map__get(cpus); =20 - err =3D 0; + err =3D TEST_OK; =20 perf_cpu_map__for_each_cpu(cpu, idx, cpus) { unsigned int expected; @@ -98,7 +100,7 @@ static int test__openat_syscall_event_on_all_cpus(struct= test_suite *test __mayb =20 if (evsel__read_on_cpu(evsel, idx, 0) < 0) { pr_debug("evsel__read_on_cpu\n"); - err =3D -1; + err =3D TEST_FAIL; break; } =20 @@ -106,7 +108,7 @@ static int test__openat_syscall_event_on_all_cpus(struc= t test_suite *test __mayb if (perf_counts(evsel->counts, idx, 0)->val !=3D expected) { pr_debug("evsel__read_on_cpu: expected to intercept %d calls on cpu %d,= got %" PRIu64 "\n", expected, cpu.cpu, perf_counts(evsel->counts, idx, 0)->val); - err =3D -1; + err =3D TEST_FAIL; } } =20 @@ -122,4 +124,15 @@ static int test__openat_syscall_event_on_all_cpus(stru= ct test_suite *test __mayb return err; } =20 -DEFINE_SUITE("Detect openat syscall event on all cpus", openat_syscall_eve= nt_on_all_cpus); + +static struct test_case tests__openat_syscall_event_on_all_cpus[] =3D { + TEST_CASE_REASON("Detect openat syscall event on all cpus", + openat_syscall_event_on_all_cpus, + "permissions"), + { .name =3D NULL, } +}; + +struct test_suite suite__openat_syscall_event_on_all_cpus =3D { + .desc =3D "Detect openat syscall event on all cpus", + .test_cases =3D tests__openat_syscall_event_on_all_cpus, +}; diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-sy= scall.c index 7f4c13c4b14d..7e05b8b5cc95 100644 --- a/tools/perf/tests/openat-syscall.c +++ b/tools/perf/tests/openat-syscall.c @@ -16,7 +16,7 @@ static int test__openat_syscall_event(struct test_suite *test __maybe_unus= ed, int subtest __maybe_unused) { - int err =3D -1, fd; + int err =3D TEST_FAIL, fd; struct evsel *evsel; unsigned int nr_openat_calls =3D 111, i; struct perf_thread_map *threads =3D thread_map__new(-1, getpid(), UINT_MA= X); @@ -25,13 +25,14 @@ static int test__openat_syscall_event(struct test_suite= *test __maybe_unused, =20 if (threads =3D=3D NULL) { pr_debug("thread_map__new\n"); - return -1; + return TEST_FAIL; } =20 evsel =3D evsel__newtp("syscalls", "sys_enter_openat"); if (IS_ERR(evsel)) { tracing_path__strerror_open_tp(errno, errbuf, sizeof(errbuf), "syscalls"= , "sys_enter_openat"); pr_debug("%s\n", errbuf); + err =3D TEST_SKIP; goto out_thread_map_delete; } =20 @@ -39,6 +40,7 @@ static int test__openat_syscall_event(struct test_suite *= test __maybe_unused, pr_debug("failed to open counter: %s, " "tweak /proc/sys/kernel/perf_event_paranoid?\n", str_error_r(errno, sbuf, sizeof(sbuf))); + err =3D TEST_SKIP; goto out_evsel_delete; } =20 @@ -58,7 +60,7 @@ static int test__openat_syscall_event(struct test_suite *= test __maybe_unused, goto out_close_fd; } =20 - err =3D 0; + err =3D TEST_OK; out_close_fd: perf_evsel__close_fd(&evsel->core); out_evsel_delete: @@ -68,4 +70,14 @@ static int test__openat_syscall_event(struct test_suite = *test __maybe_unused, return err; } =20 -DEFINE_SUITE("Detect openat syscall event", openat_syscall_event); +static struct test_case tests__openat_syscall_event[] =3D { + TEST_CASE_REASON("Detect openat syscall event", + openat_syscall_event, + "permissions"), + { .name =3D NULL, } +}; + +struct test_suite suite__openat_syscall_event =3D { + .desc =3D "Detect openat syscall event", + .test_cases =3D tests__openat_syscall_event, +}; --=20 2.36.0.550.gb090851708-goog From nobody Sun May 10 09:54:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD031C433EF for ; Fri, 13 May 2022 04:06:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376985AbiEMEF7 (ORCPT ); Fri, 13 May 2022 00:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376942AbiEMEFg (ORCPT ); Fri, 13 May 2022 00:05:36 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E043929B03F for ; Thu, 12 May 2022 21:05:34 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id m136-20020a25268e000000b0064b233e03d1so6254267ybm.14 for ; Thu, 12 May 2022 21:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=YnV5trOl0KkVtbfV7+spiE3dNbfJVrO/n7Q27X48qls=; b=KAfbU78oWArs3iQP9D8et6l1CENXxZLiD9Xik6r+YK9/Y+/IH5m66bvk4kXon9QT6U iwTuHDJFwZl26xdQGjsV1ZaiDEs+NYnJYEp8Q3nmgQNFhHbSkPy4zTtUcjzfBtPyNfqa lK8jKjh0H/ufSKjJZsrNC7RTrTXILvWs0vWq2vHWeJrF8hOjWgv0n6GK7kIRb6lgFGWP DyRCxS9NBPZvXyz5NwQcWajq7bgxRjYEAZO6T/BV1h0aCCiVjsWl9ltuLGs2IGCC1Fss 4LCysmf+P+eo/W2hlrke/e+IL2kRaSZ0ozPYYuQizhGpO5j0i+alxiq/l+3ADDmy5gfi nqmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=YnV5trOl0KkVtbfV7+spiE3dNbfJVrO/n7Q27X48qls=; b=11xIuTrOXRYYo2TMA83kWZ3vHh4bGCyU0rHaD7cWKbvRFYDBojNn9TztOMETqqsVWU Ylk6dAawCiIFBjj60J1Vvg1Jh96X3JvOF8niSUDC5pRYwN7J8XOxSLnr0xfXvyP37lXd uz01xRosaZAuK3g+VR/8wNviPE1FzjTgxkZkiMiYABc1DoGKhoNG20pTOImfXAe81bFy E8LepFIjUwO73JYaNWIhOuqBZaWSYrFuvz7NmvM2kOruHI8dKpfNsnQWExrdpqmV/7wO KKomTnoCwm8QSCA9b9LrB23C3AYqOFgy/x/UrXEq9COltWnvZLeQ6kuBNxpNlWKc29fg zFNw== X-Gm-Message-State: AOAM533mrjfLUvVTDU27f6kap6xX+GC89I9Rw6hjl4dFRYudHXPQjxKx KmVWb/A6sjFsoaYugiJeSRSY4t0uonaG X-Google-Smtp-Source: ABdhPJwQBA1Wj8Te1Bc3ceC61d+MP096QHfl+4mpcj4AdvZwLGmUgP2gIQyb1UNvQW9zY/RiSQ98mZ49Df3J X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:9b61:c91f:ca29:ae54]) (user=irogers job=sendgmr) by 2002:a25:e606:0:b0:648:402e:598a with SMTP id d6-20020a25e606000000b00648402e598amr2974368ybh.170.1652414733975; Thu, 12 May 2022 21:05:33 -0700 (PDT) Date: Thu, 12 May 2022 21:05:16 -0700 In-Reply-To: <20220513040519.1499333-1-irogers@google.com> Message-Id: <20220513040519.1499333-5-irogers@google.com> Mime-Version: 1.0 References: <20220513040519.1499333-1-irogers@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH 4/7] perf test: Basic mmap use skip From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Riccardo Mancini , Sohaib Mohamed , Carsten Haitzler , Marco Elver , John Garry , Michael Petlan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If opening the first event fails for basic mmap it is more likely permission related that a true error. Mark the test as skip in this case and add a skip reason. Signed-off-by: Ian Rogers --- tools/perf/tests/mmap-basic.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index c3c17600f29c..32f0a63fa157 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -31,7 +31,7 @@ */ static int test__basic_mmap(struct test_suite *test __maybe_unused, int su= btest __maybe_unused) { - int err =3D -1; + int err =3D TEST_FAIL; union perf_event *event; struct perf_thread_map *threads; struct perf_cpu_map *cpus; @@ -83,6 +83,14 @@ static int test__basic_mmap(struct test_suite *test __ma= ybe_unused, int subtest evsels[i] =3D evsel__newtp("syscalls", name); if (IS_ERR(evsels[i])) { pr_debug("evsel__new(%s)\n", name); + if (i =3D=3D 0) { + /* + * Failure to open first event is more likely + * related to permissions so flag the failure as + * a skip. + */ + err =3D TEST_SKIP; + } goto out_delete_evlist; } =20 @@ -166,4 +174,14 @@ static int test__basic_mmap(struct test_suite *test __= maybe_unused, int subtest return err; } =20 -DEFINE_SUITE("Read samples using the mmap interface", basic_mmap); +static struct test_case tests__basic_mmap[] =3D { + TEST_CASE_REASON("Read samples using the mmap interface", + basic_mmap, + "permissions"), + { .name =3D NULL, } +}; + +struct test_suite suite__basic_mmap =3D { + .desc =3D "Read samples using the mmap interface", + .test_cases =3D tests__basic_mmap, +}; --=20 2.36.0.550.gb090851708-goog From nobody Sun May 10 09:54:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52403C433EF for ; Fri, 13 May 2022 04:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376961AbiEMEFx (ORCPT ); Fri, 13 May 2022 00:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376946AbiEMEFi (ORCPT ); Fri, 13 May 2022 00:05:38 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5752229B025 for ; Thu, 12 May 2022 21:05:37 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2f9299dfb81so62175287b3.6 for ; Thu, 12 May 2022 21:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=MAjYUcMF8cvSpD3IrXmmGZ0bseIJMHTYZTi0/EOkzbY=; b=DNyinQnf/GUhB5FLBjS/bka3DAXeZ27SjcHtaiafd1Qa3TdKFMJt+APa+eIJ94K/9c M2Kmp0d2XIqVr7OgZAk1uQ7LRJ8yfxqj0a/801WoLD14owWZO85tRgRSn9Ce+1KF9FN7 S0jsg8y8RBplqLugtk2HKhLIpuHn0vlX53V0xyh0S4u81HTT6TFRwsKbjYZlbnYxNT7B SwvMHY4CmmZ2hJuhE8VVNH3UTeaHaOBzCIVRCdZMO6Yv9LRvV1dkV74szp0o9qf5cEkC PqRsbQjbtbMjq0xx5n0nYy0jOm7irRg2CsfHLBcwEhaxoKqhiViCwJb0EFIWdIOdAGrs fO3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=MAjYUcMF8cvSpD3IrXmmGZ0bseIJMHTYZTi0/EOkzbY=; b=xymk+Mf3k/066oTKrJjlVEpTWIvEV+kUjyd84nobaz0CQ3KvVakZ7aKHAgvtCf8eVx +4w0eLoeVFloJLlFXqiaXx96DQH3DiXzXbzUXC+vuyz6vhYYfx7CRzkc5IP4e4CiznQ0 /L2WWC/d3tKM/0Hf0RIIOE7Mj8k/QPu8daXlNfHg3g/BlCJ4Ag7/xoEH1AjSNP9AYeY8 EQ9tpnvRPZ6SBLSIMNE+mRZ2/67h3A7BCOLtBVFr1N74jaimmLb8H+dUfVHRa3p/5lxv sWq/AuMexbpPuMdyLxy4iSpTnY4hKh4Q3lY9n1N99uOeAnRZywsKaoTpPxviejGiOaB/ 8f5Q== X-Gm-Message-State: AOAM531tspd+aHIgg5ziWIF78P2aZ3SnYTKyRDI+0rPz1I4XxlUe6JMN CE7P3zIq7f6JkwEqjWPXcFwImtv6DwfF X-Google-Smtp-Source: ABdhPJx7EU8oJlo555wKZBuqFQ51tkxeRs8J6Bf5Kloe7Bej4z8wYTVAiSh8jJYEqJ11bCd2O1L2U7vU3hkT X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:9b61:c91f:ca29:ae54]) (user=irogers job=sendgmr) by 2002:a25:dfc3:0:b0:64b:3228:73fc with SMTP id w186-20020a25dfc3000000b0064b322873fcmr2977029ybg.441.1652414736234; Thu, 12 May 2022 21:05:36 -0700 (PDT) Date: Thu, 12 May 2022 21:05:17 -0700 In-Reply-To: <20220513040519.1499333-1-irogers@google.com> Message-Id: <20220513040519.1499333-6-irogers@google.com> Mime-Version: 1.0 References: <20220513040519.1499333-1-irogers@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH 5/7] perf test: Parse events tidy terms_test From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Riccardo Mancini , Sohaib Mohamed , Carsten Haitzler , Marco Elver , John Garry , Michael Petlan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove an unused variables. Make structs const. Fix checkpatch issue wrt unsigned not being with an int. Signed-off-by: Ian Rogers --- tools/perf/tests/parse-events.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-event= s.c index e71efadb24f5..7e802666d2d5 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -1980,11 +1980,10 @@ static struct evlist_test test__events_pmu[] =3D { =20 struct terms_test { const char *str; - __u32 type; int (*check)(struct list_head *terms); }; =20 -static struct terms_test test__terms[] =3D { +static const struct terms_test test__terms[] =3D { [0] =3D { .str =3D "config=3D10,config1,config2=3D3,umask=3D1,read,r0xead", .check =3D test__checkterms_simple, @@ -2112,7 +2111,7 @@ static int test_events(struct evlist_test *events, un= signed cnt) return ret2; } =20 -static int test_term(struct terms_test *t) +static int test_term(const struct terms_test *t) { struct list_head terms; int ret; @@ -2139,13 +2138,12 @@ static int test_term(struct terms_test *t) return ret; } =20 -static int test_terms(struct terms_test *terms, unsigned cnt) +static int test_terms(const struct terms_test *terms, int cnt) { int ret =3D 0; - unsigned i; =20 - for (i =3D 0; i < cnt; i++) { - struct terms_test *t =3D &terms[i]; + for (int i =3D 0; i < cnt; i++) { + const struct terms_test *t =3D &terms[i]; =20 pr_debug("running test %d '%s'\n", i, t->str); ret =3D test_term(t); --=20 2.36.0.550.gb090851708-goog From nobody Sun May 10 09:54:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F21FC433EF for ; Fri, 13 May 2022 04:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376964AbiEMEGC (ORCPT ); Fri, 13 May 2022 00:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376957AbiEMEFo (ORCPT ); Fri, 13 May 2022 00:05:44 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C30629B803 for ; Thu, 12 May 2022 21:05:39 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-2f4e758e54bso62906937b3.3 for ; Thu, 12 May 2022 21:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=TnD0korMG/FM5gYCmH1Njrgw72EedmnJt8tATKJ2XT4=; b=NhFU70+jUkH6Xs/DRPBKYk9SVj37j5JgUr130xJph6Oa1nXGnY+pynQZFbB0x2QgEW fnk2bRDjMyTOlj+U3SUp5DsZLmTNEub+i2TPKpAryG/EDEb/i/PChYsy162VJhIwvXSc U/gmbEZAukjnN6aPe/Avp90oYhDHLv6eQ/LVH09HwGVCoq5ibEnllVdNBvc0U8RsT6/r GG76E4xz+V3aN2CiWUbSrkl4RWg4fZY5QLLHiQu+3ntYS/83jTlXSpEWh+Kz97jtjm9f 2ahcG8qg0IDv1SlkDMOJ+X1J1GrebysNfYdZFuxAK4oS3xilSpRomu0K1iAvW5OwXtzm zdOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=TnD0korMG/FM5gYCmH1Njrgw72EedmnJt8tATKJ2XT4=; b=JRxCGUL404du7INHPVD62eWXWxcmlZKyMPTVoLJqGNxiECRP5U70aUww2MqICciqds 2wnkWDgfA9iEAJvLBgJ39JxUX/BoCMcMJJTj/z/QXXTYsVRAE3AF6glNrdtwjDGKRObf 1zquNcBRHMp3ew60hYhmuSCIWdVgzqtcJxN+bI6ShXTazLggKcAvHhh4lSKm++poRHWc uXtIRyhQvJjRegoOAIx3uqNmwHrXNplI5n6krwGVnp+edRoDPhuQR7p+D7/YCaTJyBMN a5uxzIz1Y30zSkyN1vxGfFVztDFHgrZet4h1Ui21+0aAVXwZyx8dz+5iU7G/lvFCA9md 6QlA== X-Gm-Message-State: AOAM533vVGgtLSx3wV3/W6cdkNuuQ8a2NgNknNTruXFCmatXxILfgvrh Vfmgxym3vF7/v/1r+tjt0mcPPQYj9Sfq X-Google-Smtp-Source: ABdhPJyRJClZHRVNKvXMKYU+qn0EeLQUmE1vcwd2mzKgluCGehzMIzNkGEA7RShVt6x+XCyx9gEATmJiXyN/ X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:9b61:c91f:ca29:ae54]) (user=irogers job=sendgmr) by 2002:a81:2dc5:0:b0:2f5:c6c8:9ee5 with SMTP id t188-20020a812dc5000000b002f5c6c89ee5mr3611346ywt.518.1652414738368; Thu, 12 May 2022 21:05:38 -0700 (PDT) Date: Thu, 12 May 2022 21:05:18 -0700 In-Reply-To: <20220513040519.1499333-1-irogers@google.com> Message-Id: <20220513040519.1499333-7-irogers@google.com> Mime-Version: 1.0 References: <20220513040519.1499333-1-irogers@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH 6/7] perf test: Parse events tidy evlist_test From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Riccardo Mancini , Sohaib Mohamed , Carsten Haitzler , Marco Elver , John Garry , Michael Petlan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove two unused variables. Make structs const. Also fix the array index (aka id) for the event software/r0x1a/. Signed-off-by: Ian Rogers --- tools/perf/tests/parse-events.c | 171 ++++++++++++++++---------------- 1 file changed, 84 insertions(+), 87 deletions(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-event= s.c index 7e802666d2d5..0d65770bd686 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -1637,344 +1637,342 @@ static int test__hybrid_cache_event(struct evlist= *evlist) =20 struct evlist_test { const char *name; - __u32 type; - const int id; bool (*valid)(void); int (*check)(struct evlist *evlist); }; =20 -static struct evlist_test test__events[] =3D { +static const struct evlist_test test__events[] =3D { { .name =3D "syscalls:sys_enter_openat", .check =3D test__checkevent_tracepoint, - .id =3D 0, + /* 0 */ }, { .name =3D "syscalls:*", .check =3D test__checkevent_tracepoint_multi, - .id =3D 1, + /* 1 */ }, { .name =3D "r1a", .check =3D test__checkevent_raw, - .id =3D 2, + /* 2 */ }, { .name =3D "1:1", .check =3D test__checkevent_numeric, - .id =3D 3, + /* 3 */ }, { .name =3D "instructions", .check =3D test__checkevent_symbolic_name, - .id =3D 4, + /* 4 */ }, { .name =3D "cycles/period=3D100000,config2/", .check =3D test__checkevent_symbolic_name_config, - .id =3D 5, + /* 5 */ }, { .name =3D "faults", .check =3D test__checkevent_symbolic_alias, - .id =3D 6, + /* 6 */ }, { .name =3D "L1-dcache-load-miss", .check =3D test__checkevent_genhw, - .id =3D 7, + /* 7 */ }, { .name =3D "mem:0", .check =3D test__checkevent_breakpoint, - .id =3D 8, + /* 8 */ }, { .name =3D "mem:0:x", .check =3D test__checkevent_breakpoint_x, - .id =3D 9, + /* 9 */ }, { .name =3D "mem:0:r", .check =3D test__checkevent_breakpoint_r, - .id =3D 10, + /* 0 */ }, { .name =3D "mem:0:w", .check =3D test__checkevent_breakpoint_w, - .id =3D 11, + /* 1 */ }, { .name =3D "syscalls:sys_enter_openat:k", .check =3D test__checkevent_tracepoint_modifier, - .id =3D 12, + /* 2 */ }, { .name =3D "syscalls:*:u", .check =3D test__checkevent_tracepoint_multi_modifier, - .id =3D 13, + /* 3 */ }, { .name =3D "r1a:kp", .check =3D test__checkevent_raw_modifier, - .id =3D 14, + /* 4 */ }, { .name =3D "1:1:hp", .check =3D test__checkevent_numeric_modifier, - .id =3D 15, + /* 5 */ }, { .name =3D "instructions:h", .check =3D test__checkevent_symbolic_name_modifier, - .id =3D 16, + /* 6 */ }, { .name =3D "faults:u", .check =3D test__checkevent_symbolic_alias_modifier, - .id =3D 17, + /* 7 */ }, { .name =3D "L1-dcache-load-miss:kp", .check =3D test__checkevent_genhw_modifier, - .id =3D 18, + /* 8 */ }, { .name =3D "mem:0:u", .check =3D test__checkevent_breakpoint_modifier, - .id =3D 19, + /* 9 */ }, { .name =3D "mem:0:x:k", .check =3D test__checkevent_breakpoint_x_modifier, - .id =3D 20, + /* 0 */ }, { .name =3D "mem:0:r:hp", .check =3D test__checkevent_breakpoint_r_modifier, - .id =3D 21, + /* 1 */ }, { .name =3D "mem:0:w:up", .check =3D test__checkevent_breakpoint_w_modifier, - .id =3D 22, + /* 2 */ }, { .name =3D "r1,syscalls:sys_enter_openat:k,1:1:hp", .check =3D test__checkevent_list, - .id =3D 23, + /* 3 */ }, { .name =3D "instructions:G", .check =3D test__checkevent_exclude_host_modifier, - .id =3D 24, + /* 4 */ }, { .name =3D "instructions:H", .check =3D test__checkevent_exclude_guest_modifier, - .id =3D 25, + /* 5 */ }, { .name =3D "mem:0:rw", .check =3D test__checkevent_breakpoint_rw, - .id =3D 26, + /* 6 */ }, { .name =3D "mem:0:rw:kp", .check =3D test__checkevent_breakpoint_rw_modifier, - .id =3D 27, + /* 7 */ }, { .name =3D "{instructions:k,cycles:upp}", .check =3D test__group1, - .id =3D 28, + /* 8 */ }, { .name =3D "{faults:k,cache-references}:u,cycles:k", .check =3D test__group2, - .id =3D 29, + /* 9 */ }, { .name =3D "group1{syscalls:sys_enter_openat:H,cycles:kppp},group2{cycle= s,1:3}:G,instructions:u", .check =3D test__group3, - .id =3D 30, + /* 0 */ }, { .name =3D "{cycles:u,instructions:kp}:p", .check =3D test__group4, - .id =3D 31, + /* 1 */ }, { .name =3D "{cycles,instructions}:G,{cycles:G,instructions:G},cycles", .check =3D test__group5, - .id =3D 32, + /* 2 */ }, { .name =3D "*:*", .check =3D test__all_tracepoints, - .id =3D 33, + /* 3 */ }, { .name =3D "{cycles,cache-misses:G}:H", .check =3D test__group_gh1, - .id =3D 34, + /* 4 */ }, { .name =3D "{cycles,cache-misses:H}:G", .check =3D test__group_gh2, - .id =3D 35, + /* 5 */ }, { .name =3D "{cycles:G,cache-misses:H}:u", .check =3D test__group_gh3, - .id =3D 36, + /* 6 */ }, { .name =3D "{cycles:G,cache-misses:H}:uG", .check =3D test__group_gh4, - .id =3D 37, + /* 7 */ }, { .name =3D "{cycles,cache-misses,branch-misses}:S", .check =3D test__leader_sample1, - .id =3D 38, + /* 8 */ }, { .name =3D "{instructions,branch-misses}:Su", .check =3D test__leader_sample2, - .id =3D 39, + /* 9 */ }, { .name =3D "instructions:uDp", .check =3D test__checkevent_pinned_modifier, - .id =3D 40, + /* 0 */ }, { .name =3D "{cycles,cache-misses,branch-misses}:D", .check =3D test__pinned_group, - .id =3D 41, + /* 1 */ }, { .name =3D "mem:0/1", .check =3D test__checkevent_breakpoint_len, - .id =3D 42, + /* 2 */ }, { .name =3D "mem:0/2:w", .check =3D test__checkevent_breakpoint_len_w, - .id =3D 43, + /* 3 */ }, { .name =3D "mem:0/4:rw:u", .check =3D test__checkevent_breakpoint_len_rw_modifier, - .id =3D 44 + /* 4 */ }, #if defined(__s390x__) { .name =3D "kvm-s390:kvm_s390_create_vm", .check =3D test__checkevent_tracepoint, .valid =3D kvm_s390_create_vm_valid, - .id =3D 100, + /* 0 */ }, #endif { .name =3D "instructions:I", .check =3D test__checkevent_exclude_idle_modifier, - .id =3D 45, + /* 5 */ }, { .name =3D "instructions:kIG", .check =3D test__checkevent_exclude_idle_modifier_1, - .id =3D 46, + /* 6 */ }, { .name =3D "task-clock:P,cycles", .check =3D test__checkevent_precise_max_modifier, - .id =3D 47, + /* 7 */ }, { .name =3D "instructions/name=3Dinsn/", .check =3D test__checkevent_config_symbol, - .id =3D 48, + /* 8 */ }, { .name =3D "r1234/name=3Drawpmu/", .check =3D test__checkevent_config_raw, - .id =3D 49, + /* 9 */ }, { .name =3D "4:0x6530160/name=3Dnumpmu/", .check =3D test__checkevent_config_num, - .id =3D 50, + /* 0 */ }, { .name =3D "L1-dcache-misses/name=3Dcachepmu/", .check =3D test__checkevent_config_cache, - .id =3D 51, + /* 1 */ }, { .name =3D "intel_pt//u", .valid =3D test__intel_pt_valid, .check =3D test__intel_pt, - .id =3D 52, + /* 2 */ }, { .name =3D "cycles/name=3D'COMPLEX_CYCLES_NAME:orig=3Dcycles,desc=3Dchip= -clock-ticks'/Duk", .check =3D test__checkevent_complex_name, - .id =3D 53 + /* 3 */ }, { .name =3D "cycles//u", .check =3D test__sym_event_slash, - .id =3D 54, + /* 4 */ }, { .name =3D "cycles:k", .check =3D test__sym_event_dc, - .id =3D 55, + /* 5 */ }, { .name =3D "instructions:uep", .check =3D test__checkevent_exclusive_modifier, - .id =3D 56, + /* 6 */ }, { .name =3D "{cycles,cache-misses,branch-misses}:e", .check =3D test__exclusive_group, - .id =3D 57, + /* 7 */ }, }; =20 -static struct evlist_test test__events_pmu[] =3D { +static const struct evlist_test test__events_pmu[] =3D { { .name =3D "cpu/config=3D10,config1,config2=3D3,period=3D1000/u", .check =3D test__checkevent_pmu, - .id =3D 0, + /* 0 */ }, { .name =3D "cpu/config=3D1,name=3Dkrava/u,cpu/config=3D2/u", .check =3D test__checkevent_pmu_name, - .id =3D 1, + /* 1 */ }, { .name =3D "cpu/config=3D1,call-graph=3Dfp,time,period=3D100000/,cpu/con= fig=3D2,call-graph=3Dno,time=3D0,period=3D2000/", .check =3D test__checkevent_pmu_partial_time_callgraph, - .id =3D 2, + /* 2 */ }, { .name =3D "cpu/name=3D'COMPLEX_CYCLES_NAME:orig=3Dcycles,desc=3Dchip-cl= ock-ticks',period=3D0x1,event=3D0x2/ukp", .check =3D test__checkevent_complex_name, - .id =3D 3, + /* 3 */ }, { .name =3D "software/r1a/", .check =3D test__checkevent_raw_pmu, - .id =3D 4, + /* 4 */ }, { .name =3D "software/r0x1a/", .check =3D test__checkevent_raw_pmu, - .id =3D 4, + /* 5 */ }, }; =20 @@ -1990,55 +1988,55 @@ static const struct terms_test test__terms[] =3D { }, }; =20 -static struct evlist_test test__hybrid_events[] =3D { +static const struct evlist_test test__hybrid_events[] =3D { { .name =3D "cpu_core/cpu-cycles/", .check =3D test__hybrid_hw_event_with_pmu, - .id =3D 0, + /* 0 */ }, { .name =3D "{cpu_core/cpu-cycles/,cpu_core/instructions/}", .check =3D test__hybrid_hw_group_event, - .id =3D 1, + /* 1 */ }, { .name =3D "{cpu-clock,cpu_core/cpu-cycles/}", .check =3D test__hybrid_sw_hw_group_event, - .id =3D 2, + /* 2 */ }, { .name =3D "{cpu_core/cpu-cycles/,cpu-clock}", .check =3D test__hybrid_hw_sw_group_event, - .id =3D 3, + /* 3 */ }, { .name =3D "{cpu_core/cpu-cycles/k,cpu_core/instructions/u}", .check =3D test__hybrid_group_modifier1, - .id =3D 4, + /* 4 */ }, { .name =3D "r1a", .check =3D test__hybrid_raw1, - .id =3D 5, + /* 5 */ }, { .name =3D "cpu_core/r1a/", .check =3D test__hybrid_raw2, - .id =3D 6, + /* 6 */ }, { .name =3D "cpu_core/config=3D10,config1,config2=3D3,period=3D1000/u", .check =3D test__checkevent_pmu, - .id =3D 7, + /* 7 */ }, { .name =3D "cpu_core/LLC-loads/", .check =3D test__hybrid_cache_event, - .id =3D 8, + /* 8 */ }, }; =20 -static int test_event(struct evlist_test *e) +static int test_event(const struct evlist_test *e) { struct parse_events_error err; struct evlist *evlist; @@ -2093,15 +2091,14 @@ static int test_event_fake_pmu(const char *str) return ret; } =20 -static int test_events(struct evlist_test *events, unsigned cnt) +static int test_events(const struct evlist_test *events, int cnt) { int ret1, ret2 =3D 0; - unsigned i; =20 - for (i =3D 0; i < cnt; i++) { - struct evlist_test *e =3D &events[i]; + for (int i =3D 0; i < cnt; i++) { + const struct evlist_test *e =3D &events[i]; =20 - pr_debug("running test %d '%s'", e->id, e->name); + pr_debug("running test %d '%s'", i, e->name); ret1 =3D test_event(e); if (ret1) ret2 =3D ret1; @@ -2193,7 +2190,7 @@ static int test_pmu_events(void) } =20 while (!ret && (ent =3D readdir(dir))) { - struct evlist_test e =3D { .id =3D 0, }; + struct evlist_test e =3D { .name =3D NULL, }; char name[2 * NAME_MAX + 1 + 12 + 3]; =20 /* Names containing . are special and cannot be used directly */ @@ -2288,7 +2285,7 @@ static int test__checkevent_pmu_events_alias(struct e= vlist *evlist) =20 static int test_pmu_events_alias(char *event, char *alias) { - struct evlist_test e =3D { .id =3D 0, }; + struct evlist_test e =3D { .name =3D NULL, }; char name[2 * NAME_MAX + 20]; =20 snprintf(name, sizeof(name), "%s/event=3D1/,%s/event=3D1/", --=20 2.36.0.550.gb090851708-goog From nobody Sun May 10 09:54:41 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F2CFC433F5 for ; Fri, 13 May 2022 04:06:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376976AbiEMEGI (ORCPT ); Fri, 13 May 2022 00:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376960AbiEMEFt (ORCPT ); Fri, 13 May 2022 00:05:49 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22FAB32C for ; Thu, 12 May 2022 21:05:41 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id x79-20020a25ce52000000b006497f075e7dso6262901ybe.15 for ; Thu, 12 May 2022 21:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=F54usjAFz5vOzrdA7Nd+K5d7QeUNwuqGITpxppLDKa4=; b=rqXz9BAvIr1lyEMUvrMwJnYC+yZM56BcVSwodvkbxmQtJcipRfryWKFUWHDPqgdJpw /npbd/1T++XC7YWSbwuL16SQLNWQjzbi9pjmtUhpd0nheC/gD+p/lds9xtuGj5Fs4qKz u9EiDL77xRErSMaADlB6GbQuwWtV8ExmdxL405mdWptFL5PuKGvz0HFyldIxlIh7Sp11 H5xHj2Y+j25qhhVtKQPBnTDCZ6UXwMhmTWTQ6BmYW/LQSSccQahFatD9/moy1iChDt+N HdW+CeGggcf+M+skPs4YlBD0QENb1+sBY91lw6u7JXI0LmyY6LSWKj2ScC06vLkdseJn uBNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=F54usjAFz5vOzrdA7Nd+K5d7QeUNwuqGITpxppLDKa4=; b=j9XkGfo7jaMcM0mZNRc3NmVtviVN7aJOn3Hom7WixfD78GT3RU+l0bCPLgYhLBOQ5x BU6vvQUGADvn+HrrONgPlUZ3hRw/6Ts0OvTmPvnF94awn7dx6WrB9ZPFlSIEZuEicCMB I23uVqYPgFudiHtKo4GhQ8+FaOE69LotZIrJlj0LyI9OLkm3Fi9JjKH1zRqfFgLQQLSr VxUWQdIfExY8KYk9FZxCf2kX5Zxd5DYnpfscGraekDzkVvB7VD1vgxygmcIGL2+qceAl +Y5PSkakFevqOlAnos0oXHn+cnNyOAYC2KxC7MET35Z5dyiW2fvBGE6dZ3YsrJjjZ7yN dUqQ== X-Gm-Message-State: AOAM530Gfb9/bxP2X4Y0XTIudBbVVzKiwsK2Rc3MAeyUARql/8RcBgVA y7OVxuZ68Y4MvyhVD266oA6xYLbwh72P X-Google-Smtp-Source: ABdhPJy0FQZXLJM4zANUXKc4+uYpyRQshWYpUf+7f8zswGNiEF3AcRDcDfqEzSMlakkWqccALPiEYGuFumiO X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:9b61:c91f:ca29:ae54]) (user=irogers job=sendgmr) by 2002:a25:cf4d:0:b0:645:755c:a5af with SMTP id f74-20020a25cf4d000000b00645755ca5afmr2914752ybg.140.1652414740430; Thu, 12 May 2022 21:05:40 -0700 (PDT) Date: Thu, 12 May 2022 21:05:19 -0700 In-Reply-To: <20220513040519.1499333-1-irogers@google.com> Message-Id: <20220513040519.1499333-8-irogers@google.com> Mime-Version: 1.0 References: <20220513040519.1499333-1-irogers@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH 7/7] perf test: Parse events break apart tests From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Riccardo Mancini , Sohaib Mohamed , Carsten Haitzler , Marco Elver , John Garry , Michael Petlan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Break multiple tests in the main test into individual test cases. Make better use of skip and add reasons. Skip also for parse event permission issues (detected by searching the error string). Rather than break out of tests on the first failure, keep going and logging to pr_debug. Signed-off-by: Ian Rogers --- tools/perf/tests/parse-events.c | 311 ++++++++++++++++++-------------- 1 file changed, 177 insertions(+), 134 deletions(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-event= s.c index 0d65770bd686..459afdb256a1 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -56,7 +56,7 @@ static int test__checkevent_tracepoint(struct evlist *evl= ist) TEST_ASSERT_VAL("wrong sample_type", PERF_TP_SAMPLE_TYPE =3D=3D evsel->core.attr.sample_type); TEST_ASSERT_VAL("wrong sample_period", 1 =3D=3D evsel->core.attr.sample_p= eriod); - return 0; + return TEST_OK; } =20 static int test__checkevent_tracepoint_multi(struct evlist *evlist) @@ -74,7 +74,7 @@ static int test__checkevent_tracepoint_multi(struct evlis= t *evlist) TEST_ASSERT_VAL("wrong sample_period", 1 =3D=3D evsel->core.attr.sample_period); } - return 0; + return TEST_OK; } =20 static int test__checkevent_raw(struct evlist *evlist) @@ -84,7 +84,7 @@ static int test__checkevent_raw(struct evlist *evlist) TEST_ASSERT_VAL("wrong number of entries", 1 =3D=3D evlist->core.nr_entri= es); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW =3D=3D evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 0x1a =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__checkevent_numeric(struct evlist *evlist) @@ -94,7 +94,7 @@ static int test__checkevent_numeric(struct evlist *evlist) TEST_ASSERT_VAL("wrong number of entries", 1 =3D=3D evlist->core.nr_entri= es); TEST_ASSERT_VAL("wrong type", 1 =3D=3D evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 1 =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__checkevent_symbolic_name(struct evlist *evlist) @@ -105,7 +105,7 @@ static int test__checkevent_symbolic_name(struct evlist= *evlist) TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE =3D=3D evsel->core.attr.= type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_HW_INSTRUCTIONS =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__checkevent_symbolic_name_config(struct evlist *evlist) @@ -126,7 +126,7 @@ static int test__checkevent_symbolic_name_config(struct= evlist *evlist) 0 =3D=3D evsel->core.attr.config1); TEST_ASSERT_VAL("wrong config2", 1 =3D=3D evsel->core.attr.config2); - return 0; + return TEST_OK; } =20 static int test__checkevent_symbolic_alias(struct evlist *evlist) @@ -137,7 +137,7 @@ static int test__checkevent_symbolic_alias(struct evlis= t *evlist) TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE =3D=3D evsel->core.attr.= type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_SW_PAGE_FAULTS =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__checkevent_genhw(struct evlist *evlist) @@ -147,7 +147,7 @@ static int test__checkevent_genhw(struct evlist *evlist) TEST_ASSERT_VAL("wrong number of entries", 1 =3D=3D evlist->core.nr_entri= es); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE =3D=3D evsel->core.attr.= type); TEST_ASSERT_VAL("wrong config", (1 << 16) =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__checkevent_breakpoint(struct evlist *evlist) @@ -161,7 +161,7 @@ static int test__checkevent_breakpoint(struct evlist *e= vlist) evsel->core.attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 =3D=3D evsel->core.attr.bp_len); - return 0; + return TEST_OK; } =20 static int test__checkevent_breakpoint_x(struct evlist *evlist) @@ -174,7 +174,7 @@ static int test__checkevent_breakpoint_x(struct evlist = *evlist) TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_X =3D=3D evsel->core.attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", sizeof(long) =3D=3D evsel->core.attr.bp_l= en); - return 0; + return TEST_OK; } =20 static int test__checkevent_breakpoint_r(struct evlist *evlist) @@ -189,7 +189,7 @@ static int test__checkevent_breakpoint_r(struct evlist = *evlist) HW_BREAKPOINT_R =3D=3D evsel->core.attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 =3D=3D evsel->core.attr.bp_len); - return 0; + return TEST_OK; } =20 static int test__checkevent_breakpoint_w(struct evlist *evlist) @@ -204,7 +204,7 @@ static int test__checkevent_breakpoint_w(struct evlist = *evlist) HW_BREAKPOINT_W =3D=3D evsel->core.attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 =3D=3D evsel->core.attr.bp_len); - return 0; + return TEST_OK; } =20 static int test__checkevent_breakpoint_rw(struct evlist *evlist) @@ -219,7 +219,7 @@ static int test__checkevent_breakpoint_rw(struct evlist= *evlist) (HW_BREAKPOINT_R|HW_BREAKPOINT_W) =3D=3D evsel->core.attr.bp_type); TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 =3D=3D evsel->core.attr.bp_len); - return 0; + return TEST_OK; } =20 static int test__checkevent_tracepoint_modifier(struct evlist *evlist) @@ -450,7 +450,7 @@ static int test__checkevent_pmu(struct evlist *evlist) */ TEST_ASSERT_VAL("wrong period", 0 =3D=3D evsel->core.attr.sample_peri= od); =20 - return 0; + return TEST_OK; } =20 static int test__checkevent_list(struct evlist *evlist) @@ -489,7 +489,7 @@ static int test__checkevent_list(struct evlist *evlist) TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); =20 - return 0; + return TEST_OK; } =20 static int test__checkevent_pmu_name(struct evlist *evlist) @@ -510,7 +510,7 @@ static int test__checkevent_pmu_name(struct evlist *evl= ist) TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "cpu/config=3D2/u")); =20 - return 0; + return TEST_OK; } =20 static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evli= st) @@ -541,7 +541,7 @@ static int test__checkevent_pmu_partial_time_callgraph(= struct evlist *evlist) TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.samp= le_type)); =20 - return 0; + return TEST_OK; } =20 static int test__checkevent_pmu_events(struct evlist *evlist) @@ -559,7 +559,7 @@ static int test__checkevent_pmu_events(struct evlist *e= vlist) TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); =20 - return 0; + return TEST_OK; } =20 =20 @@ -591,7 +591,7 @@ static int test__checkevent_pmu_events_mix(struct evlis= t *evlist) TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.pinned); =20 - return 0; + return TEST_OK; } =20 static int test__checkterms_simple(struct list_head *terms) @@ -662,7 +662,7 @@ static int test__checkterms_simple(struct list_head *te= rms) term->type_val =3D=3D PARSE_EVENTS__TERM_TYPE_NUM); TEST_ASSERT_VAL("wrong val", term->val.num =3D=3D 0xead); TEST_ASSERT_VAL("wrong config", !strcmp(term->config, "config")); - return 0; + return TEST_OK; } =20 static int test__group1(struct evlist *evlist) @@ -704,7 +704,7 @@ static int test__group1(struct evlist *evlist) TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) =3D=3D 1); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); =20 - return 0; + return TEST_OK; } =20 static int test__group2(struct evlist *evlist) @@ -759,7 +759,7 @@ static int test__group2(struct evlist *evlist) TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); =20 - return 0; + return TEST_OK; } =20 static int test__group3(struct evlist *evlist __maybe_unused) @@ -851,7 +851,7 @@ static int test__group3(struct evlist *evlist __maybe_u= nused) TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); =20 - return 0; + return TEST_OK; } =20 static int test__group4(struct evlist *evlist __maybe_unused) @@ -895,7 +895,7 @@ static int test__group4(struct evlist *evlist __maybe_u= nused) TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) =3D=3D 1); TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); =20 - return 0; + return TEST_OK; } =20 static int test__group5(struct evlist *evlist __maybe_unused) @@ -981,7 +981,7 @@ static int test__group5(struct evlist *evlist __maybe_u= nused) TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); =20 - return 0; + return TEST_OK; } =20 static int test__group_gh1(struct evlist *evlist) @@ -1021,7 +1021,7 @@ static int test__group_gh1(struct evlist *evlist) TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) =3D=3D 1); =20 - return 0; + return TEST_OK; } =20 static int test__group_gh2(struct evlist *evlist) @@ -1061,7 +1061,7 @@ static int test__group_gh2(struct evlist *evlist) TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) =3D=3D 1); =20 - return 0; + return TEST_OK; } =20 static int test__group_gh3(struct evlist *evlist) @@ -1101,7 +1101,7 @@ static int test__group_gh3(struct evlist *evlist) TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) =3D=3D 1); =20 - return 0; + return TEST_OK; } =20 static int test__group_gh4(struct evlist *evlist) @@ -1141,7 +1141,7 @@ static int test__group_gh4(struct evlist *evlist) TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) =3D=3D 1); =20 - return 0; + return TEST_OK; } =20 static int test__leader_sample1(struct evlist *evlist) @@ -1194,7 +1194,7 @@ static int test__leader_sample1(struct evlist *evlist) TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); =20 - return 0; + return TEST_OK; } =20 static int test__leader_sample2(struct evlist *evlist __maybe_unused) @@ -1233,7 +1233,7 @@ static int test__leader_sample2(struct evlist *evlist= __maybe_unused) TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); =20 - return 0; + return TEST_OK; } =20 static int test__checkevent_pinned_modifier(struct evlist *evlist) @@ -1277,7 +1277,7 @@ static int test__pinned_group(struct evlist *evlist) PERF_COUNT_HW_BRANCH_MISSES =3D=3D evsel->core.attr.config); TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); =20 - return 0; + return TEST_OK; } =20 static int test__checkevent_exclusive_modifier(struct evlist *evlist) @@ -1321,7 +1321,7 @@ static int test__exclusive_group(struct evlist *evlis= t) PERF_COUNT_HW_BRANCH_MISSES =3D=3D evsel->core.attr.config); TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); =20 - return 0; + return TEST_OK; } static int test__checkevent_breakpoint_len(struct evlist *evlist) { @@ -1335,7 +1335,7 @@ static int test__checkevent_breakpoint_len(struct evl= ist *evlist) TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_1 =3D=3D evsel->core.attr.bp_len); =20 - return 0; + return TEST_OK; } =20 static int test__checkevent_breakpoint_len_w(struct evlist *evlist) @@ -1350,7 +1350,7 @@ static int test__checkevent_breakpoint_len_w(struct e= vlist *evlist) TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_2 =3D=3D evsel->core.attr.bp_len); =20 - return 0; + return TEST_OK; } =20 static int @@ -1374,7 +1374,7 @@ static int test__checkevent_precise_max_modifier(stru= ct evlist *evlist) TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE =3D=3D evsel->core.attr.= type); TEST_ASSERT_VAL("wrong config", PERF_COUNT_SW_TASK_CLOCK =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__checkevent_config_symbol(struct evlist *evlist) @@ -1382,7 +1382,7 @@ static int test__checkevent_config_symbol(struct evli= st *evlist) struct evsel *evsel =3D evlist__first(evlist); =20 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "insn") =3D=3D = 0); - return 0; + return TEST_OK; } =20 static int test__checkevent_config_raw(struct evlist *evlist) @@ -1390,7 +1390,7 @@ static int test__checkevent_config_raw(struct evlist = *evlist) struct evsel *evsel =3D evlist__first(evlist); =20 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "rawpmu") =3D= =3D 0); - return 0; + return TEST_OK; } =20 static int test__checkevent_config_num(struct evlist *evlist) @@ -1398,7 +1398,7 @@ static int test__checkevent_config_num(struct evlist = *evlist) struct evsel *evsel =3D evlist__first(evlist); =20 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "numpmu") =3D= =3D 0); - return 0; + return TEST_OK; } =20 static int test__checkevent_config_cache(struct evlist *evlist) @@ -1406,7 +1406,7 @@ static int test__checkevent_config_cache(struct evlis= t *evlist) struct evsel *evsel =3D evlist__first(evlist); =20 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "cachepmu") =3D= =3D 0); - return 0; + return TEST_OK; } =20 static bool test__intel_pt_valid(void) @@ -1419,7 +1419,7 @@ static int test__intel_pt(struct evlist *evlist) struct evsel *evsel =3D evlist__first(evlist); =20 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "intel_pt//u") = =3D=3D 0); - return 0; + return TEST_OK; } =20 static int test__checkevent_complex_name(struct evlist *evlist) @@ -1427,7 +1427,7 @@ static int test__checkevent_complex_name(struct evlis= t *evlist) struct evsel *evsel =3D evlist__first(evlist); =20 TEST_ASSERT_VAL("wrong complex name parsing", strcmp(evsel->name, "COMPLE= X_CYCLES_NAME:orig=3Dcycles,desc=3Dchip-clock-ticks") =3D=3D 0); - return 0; + return TEST_OK; } =20 static int test__checkevent_raw_pmu(struct evlist *evlist) @@ -1437,7 +1437,7 @@ static int test__checkevent_raw_pmu(struct evlist *ev= list) TEST_ASSERT_VAL("wrong number of entries", 1 =3D=3D evlist->core.nr_entri= es); TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE =3D=3D evsel->core.attr.= type); TEST_ASSERT_VAL("wrong config", 0x1a =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__sym_event_slash(struct evlist *evlist) @@ -1447,7 +1447,7 @@ static int test__sym_event_slash(struct evlist *evlis= t) TEST_ASSERT_VAL("wrong type", evsel->core.attr.type =3D=3D PERF_TYPE_HARD= WARE); TEST_ASSERT_VAL("wrong config", evsel->core.attr.config =3D=3D PERF_COUNT= _HW_CPU_CYCLES); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); - return 0; + return TEST_OK; } =20 static int test__sym_event_dc(struct evlist *evlist) @@ -1457,7 +1457,7 @@ static int test__sym_event_dc(struct evlist *evlist) TEST_ASSERT_VAL("wrong type", evsel->core.attr.type =3D=3D PERF_TYPE_HARD= WARE); TEST_ASSERT_VAL("wrong config", evsel->core.attr.config =3D=3D PERF_COUNT= _HW_CPU_CYCLES); TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); - return 0; + return TEST_OK; } =20 static int count_tracepoints(void) @@ -1521,7 +1521,7 @@ static int test__hybrid_hw_event_with_pmu(struct evli= st *evlist) TEST_ASSERT_VAL("wrong number of entries", 1 =3D=3D evlist->core.nr_entri= es); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW =3D=3D evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 0x3c =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__hybrid_hw_group_event(struct evlist *evlist) @@ -1538,7 +1538,7 @@ static int test__hybrid_hw_group_event(struct evlist = *evlist) TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW =3D=3D evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 0xc0 =3D=3D evsel->core.attr.config); TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); - return 0; + return TEST_OK; } =20 static int test__hybrid_sw_hw_group_event(struct evlist *evlist) @@ -1554,7 +1554,7 @@ static int test__hybrid_sw_hw_group_event(struct evli= st *evlist) TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW =3D=3D evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 0x3c =3D=3D evsel->core.attr.config); TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); - return 0; + return TEST_OK; } =20 static int test__hybrid_hw_sw_group_event(struct evlist *evlist) @@ -1570,7 +1570,7 @@ static int test__hybrid_hw_sw_group_event(struct evli= st *evlist) evsel =3D evsel__next(evsel); TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE =3D=3D evsel->core.attr.= type); TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); - return 0; + return TEST_OK; } =20 static int test__hybrid_group_modifier1(struct evlist *evlist) @@ -1591,7 +1591,7 @@ static int test__hybrid_group_modifier1(struct evlist= *evlist) TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); - return 0; + return TEST_OK; } =20 static int test__hybrid_raw1(struct evlist *evlist) @@ -1602,7 +1602,7 @@ static int test__hybrid_raw1(struct evlist *evlist) TEST_ASSERT_VAL("wrong number of entries", 1 =3D=3D evlist->core.nr_entr= ies); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW =3D=3D evsel->core.attr.type= ); TEST_ASSERT_VAL("wrong config", 0x1a =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 TEST_ASSERT_VAL("wrong number of entries", 2 =3D=3D evlist->core.nr_entri= es); @@ -1612,7 +1612,7 @@ static int test__hybrid_raw1(struct evlist *evlist) /* The type of second event is randome value */ evsel =3D evsel__next(evsel); TEST_ASSERT_VAL("wrong config", 0x1a =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__hybrid_raw2(struct evlist *evlist) @@ -1622,7 +1622,7 @@ static int test__hybrid_raw2(struct evlist *evlist) TEST_ASSERT_VAL("wrong number of entries", 1 =3D=3D evlist->core.nr_entri= es); TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW =3D=3D evsel->core.attr.type); TEST_ASSERT_VAL("wrong config", 0x1a =3D=3D evsel->core.attr.config); - return 0; + return TEST_OK; } =20 static int test__hybrid_cache_event(struct evlist *evlist) @@ -1632,7 +1632,7 @@ static int test__hybrid_cache_event(struct evlist *ev= list) TEST_ASSERT_VAL("wrong number of entries", 1 =3D=3D evlist->core.nr_entri= es); TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE =3D=3D evsel->core.attr.= type); TEST_ASSERT_VAL("wrong config", 0x2 =3D=3D (evsel->core.attr.config & 0xf= fffffff)); - return 0; + return TEST_OK; } =20 struct evlist_test { @@ -2043,20 +2043,24 @@ static int test_event(const struct evlist_test *e) int ret; =20 if (e->valid && !e->valid()) { - pr_debug("... SKIP"); - return 0; + pr_debug("... SKIP\n"); + return TEST_OK; } =20 evlist =3D evlist__new(); - if (evlist =3D=3D NULL) - return -ENOMEM; - + if (evlist =3D=3D NULL) { + pr_err("Failed allocation"); + return TEST_FAIL; + } parse_events_error__init(&err); ret =3D parse_events(evlist, e->name, &err); if (ret) { pr_debug("failed to parse event '%s', err %d, str '%s'\n", e->name, ret, err.str); parse_events_error__print(&err, e->name); + ret =3D TEST_FAIL; + if (strstr(err.str, "can't access trace events")) + ret =3D TEST_SKIP; } else { ret =3D e->check(evlist); } @@ -2091,21 +2095,37 @@ static int test_event_fake_pmu(const char *str) return ret; } =20 +static int combine_test_results(int existing, int latest) +{ + if (existing =3D=3D TEST_FAIL) + return TEST_FAIL; + if (existing =3D=3D TEST_SKIP) + return latest =3D=3D TEST_OK ? TEST_SKIP : latest; + return latest; +} + static int test_events(const struct evlist_test *events, int cnt) { - int ret1, ret2 =3D 0; + int ret =3D TEST_OK; =20 for (int i =3D 0; i < cnt; i++) { const struct evlist_test *e =3D &events[i]; + int test_ret; =20 - pr_debug("running test %d '%s'", i, e->name); - ret1 =3D test_event(e); - if (ret1) - ret2 =3D ret1; - pr_debug("\n"); + pr_debug("running test %d '%s'\n", i, e->name); + test_ret =3D test_event(e); + if (test_ret !=3D TEST_OK) { + pr_debug("Event test failure: test %d '%s'", i, e->name); + ret =3D combine_test_results(ret, test_ret); + } } =20 - return ret2; + return ret; +} + +static int test__events2(struct test_suite *test __maybe_unused, int subte= st __maybe_unused) +{ + return test_events(test__events, ARRAY_SIZE(test__events)); } =20 static int test_term(const struct terms_test *t) @@ -2151,6 +2171,11 @@ static int test_terms(const struct terms_test *terms= , int cnt) return ret; } =20 +static int test__terms2(struct test_suite *test __maybe_unused, int subtes= t __maybe_unused) +{ + return test_terms(test__terms, ARRAY_SIZE(test__terms)); +} + static int test_pmu(void) { struct stat st; @@ -2166,7 +2191,7 @@ static int test_pmu(void) return !ret; } =20 -static int test_pmu_events(void) +static int test__pmu_events(struct test_suite *test __maybe_unused, int su= btest __maybe_unused) { struct stat st; char path[PATH_MAX]; @@ -2174,24 +2199,29 @@ static int test_pmu_events(void) DIR *dir; int ret; =20 + if (!test_pmu()) + return TEST_SKIP; + snprintf(path, PATH_MAX, "%s/bus/event_source/devices/cpu/events/", sysfs__mountpoint()); =20 ret =3D stat(path, &st); if (ret) { - pr_debug("omitting PMU cpu events tests\n"); - return 0; + pr_debug("omitting PMU cpu events tests: %s\n", path); + return TEST_OK; } =20 dir =3D opendir(path); if (!dir) { - pr_debug("can't open pmu event dir"); - return -1; + pr_debug("can't open pmu event dir: %s\n", path); + return TEST_FAIL; } =20 - while (!ret && (ent =3D readdir(dir))) { + ret =3D TEST_OK; + while ((ent =3D readdir(dir))) { struct evlist_test e =3D { .name =3D NULL, }; char name[2 * NAME_MAX + 1 + 12 + 3]; + int test_ret; =20 /* Names containing . are special and cannot be used directly */ if (strchr(ent->d_name, '.')) @@ -2202,19 +2232,33 @@ static int test_pmu_events(void) e.name =3D name; e.check =3D test__checkevent_pmu_events; =20 - ret =3D test_event(&e); - if (ret) - break; + test_ret =3D test_event(&e); + if (test_ret !=3D TEST_OK) { + pr_debug("Test PMU event failed for '%s'", name); + ret =3D combine_test_results(ret, test_ret); + } snprintf(name, sizeof(name), "%s:u,cpu/event=3D%s/u", ent->d_name, ent->= d_name); e.name =3D name; e.check =3D test__checkevent_pmu_events_mix; - ret =3D test_event(&e); + test_ret =3D test_event(&e); + if (test_ret !=3D TEST_OK) { + pr_debug("Test PMU event failed for '%s'", name); + ret =3D combine_test_results(ret, test_ret); + } } =20 closedir(dir); return ret; } =20 +static int test__pmu_events2(struct test_suite *test __maybe_unused, int s= ubtest __maybe_unused) +{ + if (!test_pmu()) + return TEST_SKIP; + + return test_events(test__events_pmu, ARRAY_SIZE(test__events_pmu)); +} + static bool test_alias(char **event, char **alias) { char path[PATH_MAX]; @@ -2273,6 +2317,14 @@ static bool test_alias(char **event, char **alias) return false; } =20 +static int test__hybrid(struct test_suite *test __maybe_unused, int subtes= t __maybe_unused) +{ + if (!perf_pmu__has_hybrid()) + return TEST_SKIP; + + return test_events(test__hybrid_events, ARRAY_SIZE(test__hybrid_events)); +} + static int test__checkevent_pmu_events_alias(struct evlist *evlist) { struct evsel *evsel1 =3D evlist__first(evlist); @@ -2280,10 +2332,10 @@ static int test__checkevent_pmu_events_alias(struct= evlist *evlist) =20 TEST_ASSERT_VAL("wrong type", evsel1->core.attr.type =3D=3D evsel2->core.= attr.type); TEST_ASSERT_VAL("wrong config", evsel1->core.attr.config =3D=3D evsel2->c= ore.attr.config); - return 0; + return TEST_OK; } =20 -static int test_pmu_events_alias(char *event, char *alias) +static int test__pmu_events_alias(char *event, char *alias) { struct evlist_test e =3D { .name =3D NULL, }; char name[2 * NAME_MAX + 20]; @@ -2296,72 +2348,63 @@ static int test_pmu_events_alias(char *event, char = *alias) return test_event(&e); } =20 -static int test_pmu_events_alias2(void) +static int test__alias(struct test_suite *test __maybe_unused, int subtest= __maybe_unused) { - static const char events[][30] =3D { - "event-hyphen", - "event-two-hyph", - }; - unsigned long i; - int ret =3D 0; + char *event, *alias; + int ret; =20 - for (i =3D 0; i < ARRAY_SIZE(events); i++) { - ret =3D test_event_fake_pmu(&events[i][0]); - if (ret) { - pr_err("check_parse_fake %s failed\n", &events[i][0]); - break; - } - } + if (!test_alias(&event, &alias)) + return TEST_SKIP; =20 + ret =3D test__pmu_events_alias(event, alias); + + free(event); + free(alias); return ret; } =20 -static int test__parse_events(struct test_suite *test __maybe_unused, int = subtest __maybe_unused) +static int test__pmu_events_alias2(struct test_suite *test __maybe_unused, + int subtest __maybe_unused) { - int ret1, ret2 =3D 0; - char *event, *alias; - -#define TEST_EVENTS(tests) \ -do { \ - ret1 =3D test_events(tests, ARRAY_SIZE(tests)); \ - if (!ret2) \ - ret2 =3D ret1; \ -} while (0) - - if (perf_pmu__has_hybrid()) { - TEST_EVENTS(test__hybrid_events); - return ret2; - } - - TEST_EVENTS(test__events); - - if (test_pmu()) - TEST_EVENTS(test__events_pmu); - - if (test_pmu()) { - int ret =3D test_pmu_events(); - if (ret) - return ret; - } + static const char events[][30] =3D { + "event-hyphen", + "event-two-hyph", + }; + int ret =3D TEST_OK; =20 - if (test_alias(&event, &alias)) { - int ret =3D test_pmu_events_alias(event, alias); + for (unsigned int i =3D 0; i < ARRAY_SIZE(events); i++) { + int test_ret =3D test_event_fake_pmu(&events[i][0]); =20 - free(event); - free(alias); - if (ret) - return ret; + if (test_ret !=3D TEST_OK) { + pr_debug("check_parse_fake %s failed\n", &events[i][0]); + ret =3D combine_test_results(ret, test_ret); + } } =20 - ret1 =3D test_pmu_events_alias2(); - if (!ret2) - ret2 =3D ret1; - - ret1 =3D test_terms(test__terms, ARRAY_SIZE(test__terms)); - if (!ret2) - ret2 =3D ret1; - - return ret2; + return ret; } =20 -DEFINE_SUITE("Parse event definition strings", parse_events); +static struct test_case tests__parse_events[] =3D { + TEST_CASE_REASON("Test event parsing", + events2, + "permissions"), + TEST_CASE_REASON("Test parsing of \"hybrid\" CPU events", + hybrid, + "not hybrid"), + TEST_CASE_REASON("Parsing of all PMU events from sysfs", + pmu_events, + "permissions"), + TEST_CASE_REASON("Parsing of given PMU events from sysfs", + pmu_events2, + "permissions"), + TEST_CASE_REASON("Parsing of aliased events from sysfs", alias, + "no aliases in sysfs"), + TEST_CASE("Parsing of aliased events", pmu_events_alias2), + TEST_CASE("Parsing of terms (event modifiers)", terms2), + { .name =3D NULL, } +}; + +struct test_suite suite__parse_events =3D { + .desc =3D "Parse event definition strings", + .test_cases =3D tests__parse_events, +}; --=20 2.36.0.550.gb090851708-goog