Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4089704pxb; Mon, 27 Sep 2021 09:11:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3QNiNn7jAhfWrnjgbKVfC1enxqYrxs1bg1nU/rNtZy6pga9JQpxvAummZGBDlh2DZsglK X-Received: by 2002:a17:906:a018:: with SMTP id p24mr877686ejy.349.1632759067922; Mon, 27 Sep 2021 09:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632759067; cv=none; d=google.com; s=arc-20160816; b=eFzDT6O9P+LoikVJTy7dui2WynFmVCHPVB2xorlcVGZTIDydYMwCJHyubN0wLZbor+ ZImPJPDKy4gKNG5JDwqfRWFzNlOJ4u6sWNq9htMCRF5E2RVRYOZ9LUqGj3X9K4DlMgnV /eN/ZTrdtV9653fuKJqDPAslipdzMnBghcZU10vFvDCtXkGv7TTMbe2UUuWtQobhsFOS 0PZ0dU1ziREQFLSmZXyxPsc556mqW5Me7Zs5+q7GC2sn2Az4Vx/Cd58egz+MPXR4P2J8 UWxxdJ1hT8PUI6rDmdAJOBuScuwXo95ZOSo8kqFDukQ11G31uw1/iF9QReiNQykc4rzu jvvw== 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=vc+zXBZcx2Ulgt6pXjf3XypqL9z/VF6lQ4TfQOQtTCY=; b=lUM1JOLAkFGRwdTibFMUw417Ewt4plq/fjAct111LYqatPFEfa9lmWAey1ig+dKB0K OSEeipMZzN3PvXGDtUIsJZRK7N7ckDp2kei2gBIfFpvWSwddGkAQfCgz3ckKPwhxd+tM 0AUMfgsy451HXCHllm1F4NkJ7KM6r1S1HaGYp4XH9Ag5gUGP0e+rEpv3Q7lllgcjlDn9 MKlOtcR/hz7eBtu4SGkndGtWr1bPKCgLbueRFSgUu+JYvyRXZ7p7VShJXwoQZZzycY/7 5CF5GkbANx4tfU8GcJOXTR+RmE7chFWlBBGTA/sV2VWSWckDXn3WG7RsI1UEdOGjjKio 0oeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CRt0TwDG; 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 dd3si17709705edb.123.2021.09.27.09.10.41; Mon, 27 Sep 2021 09:11:07 -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=CRt0TwDG; 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 S235300AbhI0QKq (ORCPT + 99 others); Mon, 27 Sep 2021 12:10:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235305AbhI0QKq (ORCPT ); Mon, 27 Sep 2021 12:10:46 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F555C061575 for ; Mon, 27 Sep 2021 09:09:08 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id q3so23296302iot.3 for ; Mon, 27 Sep 2021 09:09:08 -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=vc+zXBZcx2Ulgt6pXjf3XypqL9z/VF6lQ4TfQOQtTCY=; b=CRt0TwDG0+o0s1CsN33EryD3AvRgFqaJBkrH6TZZZLgrVCDMViNPDrd/oCMAgxQ4b0 9w0UOpSH1Znd4y+oXjqKRdAGnQ7iffcFU2Tbp0xal8yD72Qdms79fPxO4vfiBFIsJpJ6 L8v1JBvfbNR6JZiE0BekbbSXzR7JJqax1Mw1K3utQQKOna6DVPePllASQFn9aU2IQf5N sC4Iqp8V2T7iWUT+V2xsyVAxr3sWZryJGK0/RjDJ6ZbJmrDs4y4+VKq6eJtJZT8iV9z1 RFkLRxp+gnqEgX4vwKaosGhPKh72BCJBJ9xpdIqZx3CW2vJnC8vVO57JMUcN2KEMCwvT Ox8A== 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=vc+zXBZcx2Ulgt6pXjf3XypqL9z/VF6lQ4TfQOQtTCY=; b=B8/K3VbVKUH2/d/ttet6tA8wNOLpVyuFP8AtmkRTK3oGrCOEyx7M2sLlk90jJyVSRX 6eBJKoyuB8M6W+BwTL6LFoj8lWsuQgEUNOTwOWpZCUpoFRdsOSq9BPe4PulBeFRg82Oe 2yXfYhleWeVZzNVCgOGMFxGYktaZaoijJOvyOMqJIUD0N3oWF53+jOPCk4mVX/bRCRFY J4ZiFwv7tzDC0rl4aJVV8qsuT0k2gK/zFcuqezIjMdrXRDaCbIQy1SPep9Ed3VwzIkcb WmHSSEbn5QEw60ta9k1UF6ocAAIedk8yPCje757kgeTAENRdmp3YdKAcZT0WLVvTBX6d 3HWA== X-Gm-Message-State: AOAM530Fe8g/2Sbdr9mIqE8y1XM5dPPdxZM9eaRc/v1+pncbPLHth54k E0cUTszkA4Dkt2g3ZPNftvqOzgVklvBJif42NG3dww== X-Received: by 2002:a05:6638:1929:: with SMTP id p41mr615306jal.21.1632758947491; Mon, 27 Sep 2021 09:09:07 -0700 (PDT) MIME-Version: 1.0 References: <20210922081959.390059-1-irogers@google.com> <20210922081959.390059-4-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Mon, 27 Sep 2021 09:08:53 -0700 Message-ID: Subject: Re: [RFC PATCH 3/5] perf test: Make each test/suite its own struct. 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 Sun, Sep 26, 2021 at 2:12 PM Jiri Olsa wrote: > > On Wed, Sep 22, 2021 at 01:19:56AM -0700, Ian Rogers wrote: > > By switching to an array of pointers to tests (later to be suites) > > the definition of the tests can be moved to the file containing the > > tests. > > > > Signed-off-by: Ian Rogers > > --- > > tools/perf/arch/arm/include/arch-tests.h | 2 +- > > tools/perf/arch/arm/tests/arch-tests.c | 21 +- > > 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 +- > > tools/perf/arch/x86/include/arch-tests.h | 2 +- > > tools/perf/arch/x86/tests/arch-tests.c | 47 ++-- > > tools/perf/tests/builtin-test.c | 273 ++++++++++++------- > > tools/perf/tests/tests.h | 6 + > > 10 files changed, 220 insertions(+), 165 deletions(-) > > > > diff --git a/tools/perf/arch/arm/include/arch-tests.h b/tools/perf/arch/arm/include/arch-tests.h > > index c62538052404..37039e80f18b 100644 > > --- a/tools/perf/arch/arm/include/arch-tests.h > > +++ b/tools/perf/arch/arm/include/arch-tests.h > > @@ -2,6 +2,6 @@ > > #ifndef ARCH_TESTS_H > > #define ARCH_TESTS_H > > > > -extern struct test arch_tests[]; > > +extern struct test *arch_tests[]; > > > > #endif > > diff --git a/tools/perf/arch/arm/tests/arch-tests.c b/tools/perf/arch/arm/tests/arch-tests.c > > index 6848101a855f..4374b0293177 100644 > > --- a/tools/perf/arch/arm/tests/arch-tests.c > > +++ b/tools/perf/arch/arm/tests/arch-tests.c > > @@ -3,18 +3,15 @@ > > #include "tests/tests.h" > > #include "arch-tests.h" > > > > -struct test arch_tests[] = { > > #ifdef HAVE_DWARF_UNWIND_SUPPORT > > - { > > - .desc = "DWARF unwind", > > - .func = test__dwarf_unwind, > > - }, > > +DEFINE_SUITE("DWARF unwind", dwarf_unwind); > > why not having this and other in here DEFINE_SUITE in > tests/dwarf-unwind.c ? it seems to get compiled in only > for supported arch Not sure I follow. In these changes I've just tried to move things around without changing the logic behind things. This sounds like a sensible follow up clean up. Thanks, Ian > jirka > > > #endif > > - { > > - .desc = "Vectors page", > > - .func = test__vectors_page, > > - }, > > - { > > - .func = NULL, > > - }, > > +DEFINE_SUITE("Vectors page", vectors_page); > > + > > +struct test *arch_tests[] = { > > +#ifdef HAVE_DWARF_UNWIND_SUPPORT > > + &dwarf_unwind, > > +#endif > > + &vectors_pages, > > + NULL, > > }; > > SNIP >