Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3407541pxb; Sun, 26 Sep 2021 14:26:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQF66385NF3eBvlou8r6g9ipLb/Z2GwiYNMxEAIxYiekeiLrpQV8gT5UONylLyiCDVjKgM X-Received: by 2002:aa7:8f01:0:b0:447:8167:46c1 with SMTP id x1-20020aa78f01000000b00447816746c1mr20581032pfr.30.1632691566101; Sun, 26 Sep 2021 14:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632691566; cv=none; d=google.com; s=arc-20160816; b=qp4rJPFZOYSaTlp7OUAxFk1QYx7lzXHTV3O3Z6SNdNC4iSo7yKFhZl62Z9XDxzEQiH SjNuv/78xutwBW0U8eZIp6baB+ILBwCZ72eIHMns5iFjQTlHPlSXouwKqp4wvjOA2neS L269LGWmYyCJDjvL18+NT1AwM7zB3sT5GiU8BK0zcW3BzavTJvTAMIm7k8/P+fxNQPlK L6/AIsgk7O1nVBrd71dH9/eYcuRq22JH5igO1ohfn1Y4oaOpQKrTi/NawiR0hJGiA76e YVWC5EtWtuetznfNN6ZKMy3xcIC/R4nHvco+Y1SJZPe8MmIdjj73eQMq7/Xmny1rIKL1 Q3JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P+U0s4rlZ/U+pddjjBk9fjbMZ+HeCXOcrSWJg804pdQ=; b=BW9cg9YtVV9aGFYlw2vKZUO136z1ueMOkQW2BC8LKQgFgVG0eILlNSZcfjOzGqPwaK +Wc77Wr0pxXW/AMHFCAl75GlIwXXzXtm/9o6h/mizLCIdhA1dM+ZzFU1WUsVcQQ45EzW 3zpsgZMmKiC+J7NxkeLX0qDMazw50r9XzodvrxORhDZpTv146x5Eroo2i7jvhi1us3Dq N2x3U/Y5/xT7Gg1HB2yaZcQjsNI7b5HZOjsjiiDoQvIpzfASdnP2Wf9fWTc0dQ8gIR+3 FELjHU/5Ii9dnuXmLjPfbKR2gDiQ+x4XzIc7UcInzZvBG22CVymcl9UwigJYJE1lpjvm hfdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DsY4XiQn; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si760059pjg.160.2021.09.26.14.25.52; Sun, 26 Sep 2021 14:26:06 -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=@redhat.com header.s=mimecast20190719 header.b=DsY4XiQn; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230176AbhIZV0r (ORCPT + 99 others); Sun, 26 Sep 2021 17:26:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32273 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbhIZV0q (ORCPT ); Sun, 26 Sep 2021 17:26:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632691509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=P+U0s4rlZ/U+pddjjBk9fjbMZ+HeCXOcrSWJg804pdQ=; b=DsY4XiQn+BcgxRdRA6KNNqxT+1pPUcJLSQr3GdkITk0n9kaoKcTGMTUciOE9/4bqBwynAg wXj7oufu4QxlhZNwtX6l2ZWc6+N7C4eDItQ/AeICq0bMlpWwTmq/LUGj/sco2w4ryWg3OL vqXH1m4vMnZLotq2uibyEJJPRmE9+VA= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-292-eXm4MDm4Ny6X6DNMeSJuAw-1; Sun, 26 Sep 2021 17:25:07 -0400 X-MC-Unique: eXm4MDm4Ny6X6DNMeSJuAw-1 Received: by mail-ed1-f70.google.com with SMTP id h6-20020a50c386000000b003da01adc065so15550297edf.7 for ; Sun, 26 Sep 2021 14:25:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=P+U0s4rlZ/U+pddjjBk9fjbMZ+HeCXOcrSWJg804pdQ=; b=w5WkxwUgFVi8K6zz8sNfkyucKcrk4DCFPUmDLPALs4RF4tD+PIyaCviMYguDdGH9Ut 4qHJWbRVnOfv0wknoPIwOdUoYCxWJcFOZRZJuBE/4uZRNVD9kJbMTmiFK5C3RVggaXYk gpx1PRv0TXNlwnQ1cgMraZ17XdQmPq5LeUzGWvVlNZBx2G9J9MDFzGEg169QhrtLDEBS Z7FSU/+jgxTb1uc7InsWQn1k40Kje6Oy353pHqpW2wvpZ3VYXHJCdGJeFRpNc/UXjjwi 5AZuYhWDIe8okQ8cglv4JrI/vclbCuotggsjXJuLXv98GWEdacRq4Wl75sc9NWDlSxdd YO5w== X-Gm-Message-State: AOAM532sRa+3D5bG0BgtW9Rc0YyiTk8B4AL3Bqq2L3Ogmzgd1pMqKkyr zCZDLlQnoZrgwmRnlioYy6oHTVJjz9VTkQOOhKitjSX9FR5rR4Ys7nNR6qCeCOTtwW3JrHFsFTN FiETHxtje4SETg/qE77JHsl/6 X-Received: by 2002:a05:6402:1b92:: with SMTP id cc18mr13320454edb.31.1632691506455; Sun, 26 Sep 2021 14:25:06 -0700 (PDT) X-Received: by 2002:a05:6402:1b92:: with SMTP id cc18mr13320441edb.31.1632691506267; Sun, 26 Sep 2021 14:25:06 -0700 (PDT) Received: from krava ([83.240.63.48]) by smtp.gmail.com with ESMTPSA id f2sm7740640eje.109.2021.09.26.14.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 14:25:05 -0700 (PDT) Date: Sun, 26 Sep 2021 23:25:03 +0200 From: Jiri Olsa To: Ian Rogers 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 Subject: Re: [RFC PATCH 0/5] Start aligning perf test with kunit style Message-ID: References: <20210922081959.390059-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 04:36:05PM -0700, Ian Rogers wrote: > 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. it compiles fine on powerpc and failed tests seem reasonable, before/after perf test output is same apart from this: [root@ibm-p9z-06-lp7 perf]# diff -puw out.old out.new --- out.old 2021-09-26 17:15:57.947807813 -0400 +++ out.new 2021-09-26 17:20:51.789918644 -0400 @@ -81,7 +81,7 @@ 69: PE file support : Ok 70: Event expansion for cgroups : Ok 72: dlfilter C API : Ok -73: Test dwarf unwind : Ok +73: DWARF unwind : Ok 74: build id cache operations : Ok 75: daemon operations : Ok 76: perf pipe recording and injection test : Ok not sure there's somebody out there parsing this output, maybe we can find out ;-) jirka > > 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 > > > > > >