Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp85740pxb; Wed, 22 Sep 2021 16:41:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZQ9s8Fn9qLQzjAI2aTNLVp4B1NlxTFI49JxAnqWImz6oR3ZLKq1feUC+CBdAkGSqQLZCD X-Received: by 2002:a17:906:29d0:: with SMTP id y16mr1971223eje.477.1632354084624; Wed, 22 Sep 2021 16:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632354084; cv=none; d=google.com; s=arc-20160816; b=ophakKFIXVqn6PDCEez/HaZkse5JTfs5z+P6zcSQOOEuv3b3I+uA3vktbD+G9E3+SF KFB3W5gGOnqY5Dj+oO1hb6G7fjYdJGCENn+HRCZ/+ijCS4JDPNewvgfC8b1ABQOzHr5H v2Xx6QI+64tHjgqRq52M/w9sYGTy1u6R2r/A2/HbhvMVIpjcYfhSCFL7xs5O8IQk8aPk 8UC6efGx2x7KRg6Wrok/2PPk+H7bUIkLxlFZmnPrrQUeKRXr3Ol6LLFp5tNPRnc9ZQUY O0i46vd08R/RecBOL0dsxvJqr/Z1Da+e7ZA5sIKNo8NI3C6+qRyJnP68YWrlWC0bgvYU 1rCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Pqt30ORAt5NIIu5Ce0uJ1yGi0D7yTHJUmzoEu1HIAiE=; b=IOK0z4VTNoLmrQDHL5VO8/cj0VQdVPakb9Km/QDdsKSHE6yen2j6FT8UkZLoFK3wln 93D7iqTZMdXjAtCIhUqdxph6ubOK5YDdDJV/plodoEs67gwMNr7dwj0t4CL+tmnMJxEJ CmRY7KdFsHFbsFZIC4edqM7VxcBca5LsjHqFRTEEaYgFzVnR0bYuPU8C2510LNGbqHbi 0QrmX9Yy8QTRxx6VIMjOVDlxgmtcVtkco3LKQ8ecxjNpF45C96I1dDvoY12zotDXcQXS j9TFFFr38+rDXOmwH2zsk0uM8mRHbsDIGSB0AZJkkVgaF5/TMGMh+Na9WImHM+R+FNbP 71rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=gKWQdhsa; 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 l1si4422127ejo.68.2021.09.22.16.41.00; Wed, 22 Sep 2021 16:41:24 -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=gKWQdhsa; 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 S238481AbhIVXhv (ORCPT + 99 others); Wed, 22 Sep 2021 19:37:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238463AbhIVXhu (ORCPT ); Wed, 22 Sep 2021 19:37:50 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17CAEC061756 for ; Wed, 22 Sep 2021 16:36:20 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id q14so4652010ils.5 for ; Wed, 22 Sep 2021 16:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Pqt30ORAt5NIIu5Ce0uJ1yGi0D7yTHJUmzoEu1HIAiE=; b=gKWQdhsaqGb5vdiZUv6OWvX3KqOd9ZSgu8JRf3jvAdxlTcyiXRLXZ5W3/0mu9VxHlX RygN12KVwsSu7gWGfFWj2v67Q+6XqhUrx+UNl38/gPltqS+Dcs82a5KeudcriuUgOn1f fDPkcOsu0j0EJyrc0I/4kFD5yAaOK3AheX6B2q5PcJCYvek6PiNqxHz6md2Nqo+oHGVm W2dHK/oXa52fxpSxOV6MozpEukqXzTFGlQ7SYLx/OAj4CiCQ1aJlqOXejA8FAWghvmYo jo85j34T/UbMxAakKGUcyTTrFbanGumSqmVQN13oaSVRGnmPo5MC5Cdz9HvowjBC0hPu D/pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pqt30ORAt5NIIu5Ce0uJ1yGi0D7yTHJUmzoEu1HIAiE=; b=DdMHUNC2SGwaxDXmHBtbnvW0e6eoCiVPCSvd3QReLwEUbe7DrOuenylJcp0OF4gBmD O+rcq1rs0YrHZQKqLERSI2NyyICqZkwTDKzlg7woaBmtnb9xXjV2pK+ym7yvJJfs8Yzc 3wBB59YxQDzRyHOUEgQjsIsyPfwesau9CgWeh4J0IP7KYQtnpS8Xli2wJDiXOZWBM7hC Hwu53naEFt6qoDqKF63THp42NpCZPBY/yf14EB/iKTn9uyE9bHdeGwNfb93QMf/6PlyQ 3GWgyw1sF/kPlb9ZenOUI9pE8vTjH5yrFJFeda72Ug+YbCZbXiP+hdk6QThDWmSLKPo+ Twog== X-Gm-Message-State: AOAM532+28757z+KW+7JrZn5OX+fwS4eBAbvW4xrM6i28KWPwMDYssfj 3Nh3RBIYG6BKGqun7Nnjj5eP+F7p3YM/AGL12ke/VQ== X-Received: by 2002:a92:440c:: with SMTP id r12mr1259497ila.174.1632353779271; Wed, 22 Sep 2021 16:36:19 -0700 (PDT) MIME-Version: 1.0 References: <20210922081959.390059-1-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Wed, 22 Sep 2021 16:36:05 -0700 Message-ID: Subject: Re: [RFC PATCH 0/5] Start aligning perf test with kunit style To: Jiri Olsa Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , 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 , eranian@google.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 2:55 PM Jiri Olsa wrote: > > On Wed, Sep 22, 2021 at 01:19:53AM -0700, Ian Rogers wrote: > > 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. > > seems good.. how far away from kunit is the code now? Thanks Jiri, It is a ways away from complete. I was thinking to follow up with: * Migrate the current sub-test approach to use kunit style test cases within a suite. * Combine what are currently independent test suites into one test suite with different test cases, for example stat.c contains stat, stat_config and stat_round tests. Once this is done then to unify with kunit we need to work out a common pattern for skipping a test, etc. There's already a lot here and so I wanted to get an opinion before pushing along further. > > > > v1. Built/tested on x86. > > > > Ian Rogers (5): > > 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 > > > > tools/perf/arch/arm/include/arch-tests.h | 2 +- > > tools/perf/arch/arm/tests/arch-tests.c | 21 +- > > 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 | 15 +- > > tools/perf/arch/powerpc/include/arch-tests.h | 2 +- > > tools/perf/arch/powerpc/tests/arch-tests.c | 15 +- > > I can run/test this on ppc/arm if you don't have any I have pretty easy access to ARM but lost access to PowerPC. If we're happy with the direction then I can test ARM and ask for help on PowerPC. Thanks, Ian > jirka > > > tools/perf/arch/x86/include/arch-tests.h | 14 +- > > tools/perf/arch/x86/tests/arch-tests.c | 47 +- > > 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 | 10 +- > > tools/perf/tests/bp_signal.c | 8 +- > > tools/perf/tests/bp_signal_overflow.c | 8 +- > > tools/perf/tests/bpf.c | 22 +- > > tools/perf/tests/builtin-test.c | 441 ++++-------------- > > tools/perf/tests/clang.c | 18 +- > > 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 | 2 +- > > tools/perf/tests/event-times.c | 4 +- > > tools/perf/tests/event_update.c | 4 +- > > tools/perf/tests/evsel-roundtrip-name.c | 4 +- > > tools/perf/tests/evsel-tp-sched.c | 4 +- > > 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 | 22 +- > > 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 | 4 +- > > 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 | 4 +- > > 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 | 10 +- > > tools/perf/tests/pfm.c | 16 +- > > tools/perf/tests/pmu-events.c | 19 +- > > 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 | 10 +- > > 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 | 179 ++++--- > > 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 | 22 +- > > 81 files changed, 543 insertions(+), 618 deletions(-) > > > > -- > > 2.33.0.464.g1972c5931b-goog > > >