Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3403270pxb; Sun, 26 Sep 2021 14:16:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgOj+Xm5xHl7I1EyxM1aRKlngzr1eO6MiAYGOPaw4QCng6MAqpe3eq+fY2sv2yqKjOSZM+ X-Received: by 2002:a17:906:3181:: with SMTP id 1mr24005439ejy.388.1632690969868; Sun, 26 Sep 2021 14:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632690969; cv=none; d=google.com; s=arc-20160816; b=azVwMvWe2nCTAJzjjIy1g4F61sRr8VJBqlRppQbJyvC/4crkhv5NVW9t8H7lRyH2Ul dzqB32C+1r9XANB2P6bHXvVNmSlXyCFhY0TMffOwJscr3gGY8X0CK1JL6x5l/cA9kKNk iNvzn0G638+UKNsKjaVrbPCioxKkSee1TrRodE4QOUycngMdD7zCfiblTyxwlxm6kLz4 KUAMgpSiRjTiEsJNHOlVRmOFwfa7ju8ONLhq946m6g7vsW46spGuuHOOShWaFbBtH7L3 lpMviGD0IVi4OZ0BQSPXJsiVduyVzwNUv29ItaUC2P5KQ+qxoARBp2s7HmBWSB81cPNs HKbQ== 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=oTs7zwS2QXAnnsmmd+Pil13HIG5rYgAh/iri/slOgj4=; b=UzFTU/KegDLoxRy1AW9ok3LoumzCpabK1XfoccRKKOjvjrC+eSTM1Aua4vuip8ZyJq /z6fht9aMM6C8oCJndGGR9Vo3ggnRaebLES6rHA0gFGX+O4LGFy/hQE2kdchtSWsl5/K tKDD1nWONnuvoXd0j0hcyqCqiVK8qDjoXDXmuSX1qb0LQ+Q9bRMwuk7trEo4eKHwHZgW IxBgwB+/MBHntOBfhXaUsdofAmx3q4JEl07iyTTQEcUS+PCEIhGbdWgsXl6te8AW18Ya fImTCjHRLSm9u89pTxmkRx3DukxB+ess43KgrbWnK/MBs1xn81U+6iNsfzxNDsS44tc5 /jeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zb1rBvjv; 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 k24si15801225edk.120.2021.09.26.14.15.46; Sun, 26 Sep 2021 14:16:09 -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=Zb1rBvjv; 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 S230213AbhIZVN7 (ORCPT + 99 others); Sun, 26 Sep 2021 17:13:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37963 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230223AbhIZVN7 (ORCPT ); Sun, 26 Sep 2021 17:13:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632690742; 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=oTs7zwS2QXAnnsmmd+Pil13HIG5rYgAh/iri/slOgj4=; b=Zb1rBvjv2z0VByv3b0aAea0WibPaAhY6W1v5T5c9BR/qjWIELFuZ5YpDVTorh6mWGwvWBh T7S6/TPFjR6DY7ldjG09M7kaZBI2NhYJibcG849cZN46IZzCsXFJ7zptAmPFZTmDaYD4G3 taW7LD/1RcVSa2XHcg2LSlcUkpAPT3c= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-473-Zvgb6v1CM8ONC3ZevBEPOQ-1; Sun, 26 Sep 2021 17:12:20 -0400 X-MC-Unique: Zvgb6v1CM8ONC3ZevBEPOQ-1 Received: by mail-ed1-f71.google.com with SMTP id 2-20020a508e02000000b003d871759f5dso15547629edw.10 for ; Sun, 26 Sep 2021 14:12:20 -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=oTs7zwS2QXAnnsmmd+Pil13HIG5rYgAh/iri/slOgj4=; b=zacMlWAgXX0FXz3YZbhU5Bz2+s390CnS/YVT7gMBoxVHVshYEi1j20Tpo3fzGzxK9d etT6KvRrBhwtHjUHVNruYHx2AYRuSfT2+NJQOjBWzH0YbktrqhyVEttMPW//Q071+Ee2 6fP24pSeXtL6vBh79sN0zXSdBGyDklS1gsv/5DjdOBeaZa5O4ZjjRGi5Pq0pYz28hLY0 u8LcRn9poth1IC44vL68Z0+EYyCek3S7O5hq3UDhLfaKAFE0sNXf5qhANmwwHE+ZpvkQ GX0Et+cUBT/1vIHR0THrvpGb8IbY10Wr0BhcL61fSjvrquC0sjHzZ1qS04z/uvq4V4XO wmVg== X-Gm-Message-State: AOAM532jh+CAgpR08FYdku+N/w6qo0jyrDQ3lZKFzyZRxhNmObYeaMOm OF8PlwN9avfluzCU+fzqTa4K4GlD1Rh+/6ckp1L0soRu6i+RgPBlF93UVorlQ6/qTHAB2X2YAuG S9hm1gFGyCfn0aIY7eVRfo+B9 X-Received: by 2002:a50:e041:: with SMTP id g1mr14706550edl.4.1632690739731; Sun, 26 Sep 2021 14:12:19 -0700 (PDT) X-Received: by 2002:a50:e041:: with SMTP id g1mr14706534edl.4.1632690739579; Sun, 26 Sep 2021 14:12:19 -0700 (PDT) Received: from krava ([83.240.63.48]) by smtp.gmail.com with ESMTPSA id m12sm9150271edr.24.2021.09.26.14.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 14:12:19 -0700 (PDT) Date: Sun, 26 Sep 2021 23:12:16 +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 3/5] perf test: Make each test/suite its own struct. Message-ID: References: <20210922081959.390059-1-irogers@google.com> <20210922081959.390059-4-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210922081959.390059-4-irogers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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