Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5215051pxb; Tue, 28 Sep 2021 13:09:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7d40T2hWslUalLx4WPUBQ/nKYIN35JGtp0hyI2uuadn8WeauqXUYtdriEa8Kt40UpSbe+ X-Received: by 2002:a17:906:6547:: with SMTP id u7mr8897161ejn.544.1632859761490; Tue, 28 Sep 2021 13:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632859761; cv=none; d=google.com; s=arc-20160816; b=Dw+K+GrXw6XJwBgKUfM6iATX+uVKiH3rd8j2ji2H1QCiARqOePa+eJPHECJkROmIO/ iAvc2Am4eKbVWVRAkn+ExQ/VhzHgUlqoEFWLu951NME/Q16Dtk5Eib3fpuBCJ7lkN8gt j2MpwWoBwfMyHwrTrPa8jS88qCXqSSIotKdzlPIWYDdZ/cAN3mxTM3J0xPV/tDxKEGzB Fp+nPvLigr+PaIEqsw3C+uRRWcZEkj9Pz/2i9MZHeMj30REwbkhrYqraeXt+nvyf3lia sWgiXc5ik1ccgyv65W9rFGi6EJ3zBQ6YfVDzpGWW0PHpF1ElJ7KtraltHoX+DE2/8BBg R6mg== 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=Bk6tb6Ct537XzJhdSUGj/GNTfjhpoUwK2pWLiL4w+xw=; b=JRFEXYa4fKkw6RoZZgfxz7zfWsnd/mxawQohC1qWHE/ElY6NEomNW120XXdCMuxGuT 0RMe98ZYVZIz/NdqIxD32eRFoIPWWy28bEJqDGcJjWjCv3WrsVZxJQPV2tGHf2QYbvrP LSF+GaLRj26KCWSw8VxOxaO5lfAxFVBeJW824DZEDwmLj/Z01td5E1tQCy+gEYVY22rI Htjv4cte+QlR/A432gx35VNZTScGgkVrkoOQLFmETXDOd2Qlh8+W2dOqxUetosNVVm+2 p8egV2i1HkyuKlziD+2q7WsDqW+4E44ljvMD8NM6dWH/WgMKRZZCChSEO2aIdxW/0M18 bsBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KJWmK+9O; 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 cw1si7930ejc.693.2021.09.28.13.08.57; Tue, 28 Sep 2021 13:09:21 -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=KJWmK+9O; 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 S242605AbhI1UJB (ORCPT + 99 others); Tue, 28 Sep 2021 16:09:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36868 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242563AbhI1UJB (ORCPT ); Tue, 28 Sep 2021 16:09:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632859640; 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=Bk6tb6Ct537XzJhdSUGj/GNTfjhpoUwK2pWLiL4w+xw=; b=KJWmK+9OXy+yg5KPP3GY/ldgrqbIQgVw2rjRBlyG2BGqnf4/ENBWqzDMWRFOww2VE28AXi ygGtOJzC5YCQ2rzJnk3wlzESmBqzPMVHBOKkeIbHuFonmCaYHeBA0fVkxiDTLXFD+fClL/ QQxSNO/SQIJGDg76YRPIb9vpoBLUIIw= 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-224-czZybVIJPlOQZY1drpMuAQ-1; Tue, 28 Sep 2021 16:07:19 -0400 X-MC-Unique: czZybVIJPlOQZY1drpMuAQ-1 Received: by mail-ed1-f70.google.com with SMTP id s12-20020a05640217cc00b003cde58450f1so23192007edy.9 for ; Tue, 28 Sep 2021 13:07:19 -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=Bk6tb6Ct537XzJhdSUGj/GNTfjhpoUwK2pWLiL4w+xw=; b=jA+YANvENSjK61V08W2rBEmDfzXgDtfbzTPLJSyYxiD0ejh0ZuTVQ7JxQk/T1s4dv/ UzN/uqWWVfGyHeuIzvcWTrX6U5eid5Hh0AGYgf2Epa0Ib0kcckQFVgswjYaR6vNCtuoq HakQkuL1LjyhBdY1ZVP+udkCuvng1M6QadiLz1M9QrDc8+EwtfosdoLUtpq+krmrAxHS pog4abB7BlEIMF1VqEIxc1umo+eVvJAaZxi19Xs3kjmm7AsBWXAgGUW/zUHpmu7FrQoD QjR8RknngXlLEO1mWhHFEr2UfVj19wvj4PIEyebbwOnQMx/95vgUIuYXaJhZNA1XiAan 50hw== X-Gm-Message-State: AOAM531s/yu2N3OZGxyqUFGdJMkfLLw8rOpkrgCLm7u2O1Jecq7TTRyW zzL9ariMJeDW155o0CzQFlCS4NXjyjNvbJ4SZE5CDy/0sbrvXu+TcGX/eHA5i/VIKXNeSEN/evc izg+OAIj2t8XEDYEtFXOeEJQF X-Received: by 2002:a50:8d85:: with SMTP id r5mr2768009edh.312.1632859638184; Tue, 28 Sep 2021 13:07:18 -0700 (PDT) X-Received: by 2002:a50:8d85:: with SMTP id r5mr2767987edh.312.1632859638039; Tue, 28 Sep 2021 13:07:18 -0700 (PDT) Received: from krava ([83.240.63.48]) by smtp.gmail.com with ESMTPSA id ck10sm46109edb.43.2021.09.28.13.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 13:07:17 -0700 (PDT) Date: Tue, 28 Sep 2021 22:07:15 +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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 09:08:53AM -0700, Ian Rogers wrote: > 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. ah ok, maybe I mixed the proper patch to adress this, sry the question I have is why DEFINE_SUITE("DWARF unwind" .. is not moved to dwarf unwind test object, like you did for other tests thanks, jirka > > 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 > > >