Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3685335pxb; Wed, 13 Oct 2021 10:48:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUMt/Cp2NHHNo+kANK+8Y8TzJ7mu7IAOSoU+smmg8bpmxOi4FnSah7T5krWEGCyVCERtJh X-Received: by 2002:a17:90b:3786:: with SMTP id mz6mr14700807pjb.245.1634147297064; Wed, 13 Oct 2021 10:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634147297; cv=none; d=google.com; s=arc-20160816; b=o42tDptdgNPljs5yrUzTC7XR+EomXOmgvIooXSxn5m6mj0cvDSkt8QklFH0pD0SepH vrWtuxGYzidUXCEW/6K5Y15zfeBpXwhxeWMzVWitQqwjKxnV/6Z9d2SoUJvXnCi12Cc/ YyEZWXDfsdaQX6FY3iB+pgHWgssKCXmE8AcBsq0xx5Pp2zCbnYyjX1msFxDqUKHx/NgR Cq7jhzYAnRm6pWLa2zSeYln5BKkzNqnoC6aNmO3cebE7tF826UcQiJwPS0hcusIhuS2A OWunmeBuUSAjmZ/r+l2rGTvo+UnheUgT+5rLkq7czaNZqil2iXqMRY91M1YyJcXo4gte 3ewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=Zi5HmM/Iu6/fkSGLhyqm/tkYmOiHV4iGSD0CDddNH0Q=; b=g7ACMHdQNAX26SkFzEBapbNOvzuazvVwRvHTilP5CsuObV4k62PdcV6l70FrHtHcbA i0FFKFCDa/Y/LIImJiqi31hPdwuoW9cOx5mnAe/iJJIOv7eNrcwLI2Rvrx/CaWTlQfLh BNdoFaEubW8cazhb911ihPmeeUeaOwF1oKt79zf+13OeMFtv0VPZhYhiCLMTQKfuPuHV zvJAtt3v4iCUSDwDTNBD5bewFLwTjlPxg3Ql88E77HmwNOYQivwH5ZFTfYlC8wJJMoPQ dXZYv55DACzLnnIPfp/cqQbRW/4lw+/CnUWZU+otoj2pBWE0Epoc/0r4qBxK9kM1fHBw 6W0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=VGGWiTy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w19si274059pjq.94.2021.10.13.10.48.04; Wed, 13 Oct 2021 10:48:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=VGGWiTy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235702AbhJMRsa (ORCPT + 99 others); Wed, 13 Oct 2021 13:48:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238147AbhJMRs1 (ORCPT ); Wed, 13 Oct 2021 13:48:27 -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 C37DCC061753 for ; Wed, 13 Oct 2021 10:46:22 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id z2-20020a254c02000000b005b68ef4fe24so3969804yba.11 for ; Wed, 13 Oct 2021 10:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=Zi5HmM/Iu6/fkSGLhyqm/tkYmOiHV4iGSD0CDddNH0Q=; b=VGGWiTy5s9uZj6oVqPMRlagfGE5LIaoUFUuRzCfilBPRS+fJWlHbnEXUD/nhWoMqFg AGTHRbNNbNBF0kefvoq76q8Fozlqx28Z9UYaANCJ/vhJBY7AhvfQ4IScC19jEXSqCATL YBfMLGJnKGss4DP8nbrrliZuGBMYEk+nOhkwnfw9QJUIz1tQYcqSuBYfKinKmifEFKQX X8WqAl/dXscFcX+s3sHdhfNteTM83UZjlADZMm/wurOtz30Wf8niHLzPd8r00mFQ74Lo Wl8GQ91hzqVLzbemu3So9NfbjDzCuU3F5gMMJyO6EqU2V237ni/XLA79fcOLFagw3IMG JQbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Zi5HmM/Iu6/fkSGLhyqm/tkYmOiHV4iGSD0CDddNH0Q=; b=BViP5Os9c9u66wX0EhtWZ6n0ZTWAE8i+wS50/rljKOFrJX5igPZn3rTnOFHgGLV0sX mNJiDsxI/vNvhXcM1UwJ/whKXWudhDGlFRwQ8DSStIAHNURSd8jkCl38+lBrWcJ2ZN6I nCDrvUfJwXF1/4bLZW/eTW45vcGG1rXR+GDRVV4F364auyLW8PK66x15H0VAiNP75IQL 988VkfS+0eeBR1sK0LCKgLSAfADHZPscLhpC5EumpO88xaQixChsYiMRerEnzas6+8N3 mH6L4Z4ESF+EWt4zpH7ILPcVf+AnX3Quv08bX/JlvIzegUOifYhJfvT5tcbE7GEZjZ6c G5Bg== X-Gm-Message-State: AOAM531/3U7BYD2TTlBfsLVY0s1N1ijPPEP++ClHSlgRbMzyo47x4c9r x0r6+VRqiBlHUDJgyCuSvpzpKoYO8qTa X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:aeaf:8e9e:3df2:aad9]) (user=irogers job=sendgmr) by 2002:a25:4146:: with SMTP id o67mr836334yba.113.1634147181878; Wed, 13 Oct 2021 10:46:21 -0700 (PDT) Date: Wed, 13 Oct 2021 10:45:42 -0700 Message-Id: <20211013174604.747276-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH v2 00/22] Start aligning perf test with kunit style From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Jin Yao , John Garry , "Paul A . Clarke" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Higgins , Daniel Latypov , David Gow Cc: eranian@google.com, Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Perf test uses its own structs and code layout that differs from kunit that was more recently introduced to the kernel. Besides consistency, it is hoped that moving in the direction of kunit style will enable reuse of infrastructure like test output formatting for continuous testing systems. For example: https://lore.kernel.org/linux-kselftest/CA+GJov6tdjvY9x12JsJT14qn6c7NViJxqaJk+r-K1YJzPggFDQ@mail.gmail.com/ The motivation for this restructuring comes from wanting to be able to tag tests with a size: https://lore.kernel.org/linux-perf-users/CAP-5=fWmGyuqFKc-EMP3rbmTkjZ3MS+YSajGZfeRMc38HS82gw@mail.gmail.com/ To have more exhaustive and slower running tests. This isn't something kunit currently supports, nor is the execution of python and shell tests, but it seems sensible to work on an approach with kunit rather to invent a new wheel inside of perf. These initial patches are just refactoring the main test suite definitions to be in a more kunit style. Kunit isn't depended upon, it is hoped that this can be done in later patches for the sake of consistency. v2. Gets to a point of the perf test test suite/case structs being close facsimiles of the kunit ones. It also addresses feedback on the v1 RFC, in particular from Jiri Olsa . v1. Built/tested on x86. Ian Rogers (22): perf test: Use macro for "suite" declarations perf test: Use macro for "suite" definitions perf test: Make each test/suite its own struct. perf test: Move each test suite struct to its test perf test: Rename struct test to test_suite perf test: Add helper functions for abstraction. perf test: Add test case struct. perf test: Add skip reason to test case. perf test: Convert pfm tests to use test cases. perf test: Convert pmu event tests to test cases. perf test: Convert watch point tests to test cases. perf test: Convert clang tests to test cases. perf test: Convert bpf tests to test cases. perf test: Convert llvm tests to test cases. perf test: Remove now unused subtest helpers perf test: bp tests use test case perf test: Convert time to tsc test to test case. perf test: Remove non test case style support. perf test: BP tests, remove is_supported use perf test: TSC test, remove is_supported use perf test: Remove is_supported function perf test: Remove skip_if_fail tools/perf/arch/arm/include/arch-tests.h | 2 +- tools/perf/arch/arm/tests/arch-tests.c | 18 +- tools/perf/arch/arm/tests/vectors-page.c | 2 +- tools/perf/arch/arm64/include/arch-tests.h | 2 +- tools/perf/arch/arm64/tests/arch-tests.c | 11 +- tools/perf/arch/powerpc/include/arch-tests.h | 2 +- tools/perf/arch/powerpc/tests/arch-tests.c | 12 +- tools/perf/arch/x86/include/arch-tests.h | 14 +- tools/perf/arch/x86/tests/arch-tests.c | 46 +- tools/perf/arch/x86/tests/bp-modify.c | 2 +- tools/perf/arch/x86/tests/insn-x86.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 2 +- .../x86/tests/intel-pt-pkt-decoder-test.c | 2 +- tools/perf/arch/x86/tests/rdpmc.c | 2 +- tools/perf/arch/x86/tests/sample-parsing.c | 2 +- tools/perf/tests/api-io.c | 6 +- tools/perf/tests/attr.c | 4 +- tools/perf/tests/backward-ring-buffer.c | 4 +- tools/perf/tests/bitmap.c | 4 +- tools/perf/tests/bp_account.c | 36 +- tools/perf/tests/bp_signal.c | 34 +- tools/perf/tests/bp_signal_overflow.c | 9 +- tools/perf/tests/bpf.c | 69 ++- tools/perf/tests/builtin-test.c | 578 ++++++------------ tools/perf/tests/clang.c | 54 +- tools/perf/tests/code-reading.c | 4 +- tools/perf/tests/cpumap.c | 10 +- tools/perf/tests/demangle-java-test.c | 4 +- tools/perf/tests/demangle-ocaml-test.c | 4 +- tools/perf/tests/dlfilter-test.c | 4 +- tools/perf/tests/dso-data.c | 10 +- tools/perf/tests/dwarf-unwind.c | 5 +- tools/perf/tests/event-times.c | 4 +- tools/perf/tests/event_update.c | 4 +- tools/perf/tests/evsel-roundtrip-name.c | 5 +- tools/perf/tests/evsel-tp-sched.c | 5 +- tools/perf/tests/expand-cgroup.c | 6 +- tools/perf/tests/expr.c | 4 +- tools/perf/tests/fdarray.c | 7 +- tools/perf/tests/genelf.c | 6 +- tools/perf/tests/hists_cumulate.c | 4 +- tools/perf/tests/hists_filter.c | 4 +- tools/perf/tests/hists_link.c | 4 +- tools/perf/tests/hists_output.c | 4 +- tools/perf/tests/is_printable_array.c | 4 +- tools/perf/tests/keep-tracking.c | 4 +- tools/perf/tests/kmod-path.c | 4 +- tools/perf/tests/llvm.c | 74 ++- tools/perf/tests/maps.c | 4 +- tools/perf/tests/mem.c | 4 +- tools/perf/tests/mem2node.c | 4 +- tools/perf/tests/mmap-basic.c | 4 +- tools/perf/tests/mmap-thread-lookup.c | 4 +- tools/perf/tests/openat-syscall-all-cpus.c | 5 +- tools/perf/tests/openat-syscall-tp-fields.c | 5 +- tools/perf/tests/openat-syscall.c | 5 +- tools/perf/tests/parse-events.c | 4 +- tools/perf/tests/parse-metric.c | 4 +- tools/perf/tests/parse-no-sample-id-all.c | 5 +- tools/perf/tests/pe-file-parsing.c | 6 +- tools/perf/tests/perf-hooks.c | 4 +- tools/perf/tests/perf-record.c | 4 +- tools/perf/tests/perf-time-to-tsc.c | 30 +- tools/perf/tests/pfm.c | 63 +- tools/perf/tests/pmu-events.c | 73 +-- tools/perf/tests/pmu.c | 4 +- tools/perf/tests/python-use.c | 4 +- tools/perf/tests/sample-parsing.c | 4 +- tools/perf/tests/sdt.c | 6 +- tools/perf/tests/stat.c | 11 +- tools/perf/tests/sw-clock.c | 4 +- tools/perf/tests/switch-tracking.c | 4 +- tools/perf/tests/task-exit.c | 4 +- tools/perf/tests/tests.h | 238 ++++---- tools/perf/tests/thread-map.c | 10 +- tools/perf/tests/thread-maps-share.c | 4 +- tools/perf/tests/time-utils-test.c | 4 +- tools/perf/tests/topology.c | 4 +- tools/perf/tests/unit_number__scnprintf.c | 4 +- tools/perf/tests/vmlinux-kallsyms.c | 5 +- tools/perf/tests/wp.c | 122 +--- tools/perf/util/c++/clang-c.h | 8 +- tools/perf/util/c++/clang-test.cpp | 6 +- 83 files changed, 811 insertions(+), 966 deletions(-) -- 2.33.0.882.g93a45727a2-goog