linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Jin Yao <yao.jin@linux.intel.com>,
	John Garry <john.garry@huawei.com>,
	"Paul A . Clarke" <pc@us.ibm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Brendan Higgins <brendanhiggins@google.com>,
	Daniel Latypov <dlatypov@google.com>,
	David Gow <davidgow@google.com>,
	Sohaib Mohamed <sohaib.amhmd@gmail.com>,
	eranian@google.com
Subject: Re: [PATCH v3 03/22] perf test: Make each test/suite its own struct.
Date: Sat, 13 Nov 2021 10:29:31 -0300	[thread overview]
Message-ID: <YY+9uyPCJ3A0x616@kernel.org> (raw)
In-Reply-To: <YY+4WNB6GGWrkzvT@kernel.org>

Em Sat, Nov 13, 2021 at 10:06:32AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Nov 03, 2021 at 11:41:49PM -0700, Ian Rogers escreveu:
> > 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 <irogers@google.com>
> > ---
> >  tools/perf/arch/arm/include/arch-tests.h     |   2 +-
> >  tools/perf/arch/arm/tests/arch-tests.c       |  18 +-
> >  tools/perf/arch/arm64/include/arch-tests.h   |   2 +-
> >  tools/perf/arch/arm64/tests/arch-tests.c     |  11 +-
> >  tools/perf/arch/powerpc/include/arch-tests.h |   2 +-
> >  tools/perf/arch/powerpc/tests/arch-tests.c   |  11 +-
> >  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/dwarf-unwind.c              |   7 +-
> >  tools/perf/tests/tests.h                     |   8 +-
> >  11 files changed, 215 insertions(+), 168 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..5287729026ab 100644
> > --- a/tools/perf/arch/arm/tests/arch-tests.c
> > +++ b/tools/perf/arch/arm/tests/arch-tests.c
> > @@ -3,18 +3,12 @@
> >  #include "tests/tests.h"
> >  #include "arch-tests.h"
> >  
> > -struct test arch_tests[] = {
> > +DEFINE_SUITE("Vectors page", vectors_page);
> > +
> > +struct test *arch_tests[] = {
> >  #ifdef HAVE_DWARF_UNWIND_SUPPORT
> > -	{
> > -		.desc = "DWARF unwind",
> > -		.func = test__dwarf_unwind,
> > -	},
> > +	&dwarf_unwind,
> >  #endif
> > -	{
> > -		.desc = "Vectors page",
> > -		.func = test__vectors_page,
> > -	},
> > -	{
> > -		.func = NULL,
> > -	},
> > +	&vectors_pages,
> 
> Its "vector_page", not plural, I'm fixing it up from this point onwards.

Also had to add this, now fixing up the fallout in the following patches
to see if this builds on arm 32-bit.

- Arnaldo

diff --git a/tools/perf/arch/arm/tests/arch-tests.c b/tools/perf/arch/arm/tests/arch-tests.c
index ee1ee83ee6a17f38..8276740f7ff86db4 100644
--- a/tools/perf/arch/arm/tests/arch-tests.c
+++ b/tools/perf/arch/arm/tests/arch-tests.c
@@ -3,8 +3,6 @@
 #include "tests/tests.h"
 #include "arch-tests.h"
 
-DEFINE_SUITE("Vectors page", vectors_page);
-
 struct test *arch_tests[] = {
 #ifdef HAVE_DWARF_UNWIND_SUPPORT
 	&dwarf_unwind,
diff --git a/tools/perf/arch/arm/tests/vectors-page.c b/tools/perf/arch/arm/tests/vectors-page.c
index 7ffdd79971c89220..dac7b32afb655608 100644
--- a/tools/perf/arch/arm/tests/vectors-page.c
+++ b/tools/perf/arch/arm/tests/vectors-page.c
@@ -9,8 +9,7 @@
 
 #define VECTORS__MAP_NAME "[vectors]"
 
-int test__vectors_page(struct test *test __maybe_unused,
-		       int subtest __maybe_unused)
+static int test__vectors_page(struct test *test __maybe_unused, int subtest __maybe_unused)
 {
 	void *start, *end;
 
@@ -22,3 +21,5 @@ int test__vectors_page(struct test *test __maybe_unused,
 
 	return TEST_OK;
 }
+
+DEFINE_SUITE("Vectors page", vectors_page);

  reply	other threads:[~2021-11-13 13:29 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04  6:41 [PATCH v3 00/22] Start aligning perf test with kunit style Ian Rogers
2021-11-04  6:41 ` [PATCH v3 01/22] perf test: Use macro for "suite" declarations Ian Rogers
2021-11-04  6:41 ` [PATCH v3 02/22] perf test: Use macro for "suite" definitions Ian Rogers
2021-11-04  6:41 ` [PATCH v3 03/22] perf test: Make each test/suite its own struct Ian Rogers
2021-11-13 13:06   ` Arnaldo Carvalho de Melo
2021-11-13 13:29     ` Arnaldo Carvalho de Melo [this message]
2021-11-04  6:41 ` [PATCH v3 04/22] perf test: Move each test suite struct to its test Ian Rogers
2021-11-04  6:41 ` [PATCH v3 05/22] perf test: Rename struct test to test_suite Ian Rogers
2021-11-04  6:41 ` [PATCH v3 06/22] perf test: Add helper functions for abstraction Ian Rogers
2021-11-04  6:41 ` [PATCH v3 07/22] perf test: Add test case struct Ian Rogers
2021-11-04  6:41 ` [PATCH v3 08/22] perf test: Add skip reason to test case Ian Rogers
2021-11-04  6:41 ` [PATCH v3 09/22] perf test: Convert pfm tests to use test cases Ian Rogers
2021-11-04  6:41 ` [PATCH v3 10/22] perf test: Convert pmu event tests to " Ian Rogers
2021-11-04  6:41 ` [PATCH v3 11/22] perf test: Convert watch point " Ian Rogers
2021-11-04  6:41 ` [PATCH v3 12/22] perf test: Convert clang " Ian Rogers
2021-11-04  6:41 ` [PATCH v3 13/22] perf test: Convert bpf " Ian Rogers
2021-11-04  6:42 ` [PATCH v3 14/22] perf test: Convert llvm " Ian Rogers
2021-11-04  6:42 ` [PATCH v3 15/22] perf test: Remove now unused subtest helpers Ian Rogers
2021-11-04  6:42 ` [PATCH v3 16/22] perf test: bp tests use test case Ian Rogers
2021-11-04  6:42 ` [PATCH v3 17/22] perf test: Convert time to tsc test to " Ian Rogers
2021-11-04  6:42 ` [PATCH v3 18/22] perf test: Remove non test case style support Ian Rogers
2021-11-04  6:42 ` [PATCH v3 19/22] perf test: BP tests, remove is_supported use Ian Rogers
2021-11-04  6:42 ` [PATCH v3 20/22] perf test: TSC test, " Ian Rogers
2021-11-04  6:42 ` [PATCH v3 21/22] perf test: Remove is_supported function Ian Rogers
2021-11-04  6:42 ` [PATCH v3 22/22] perf test: Remove skip_if_fail Ian Rogers
2021-11-04 13:51   ` Sohaib Mohamed
2021-11-09 14:32     ` Arnaldo Carvalho de Melo
2021-11-10 15:44       ` Sohaib Mohamed
2021-11-09 11:08 ` [PATCH v3 00/22] Start aligning perf test with kunit style Jiri Olsa
2021-11-10 12:20 ` Arnaldo Carvalho de Melo
2021-11-10 16:12 ` Sohaib Mohamed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YY+9uyPCJ3A0x616@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=john.garry@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=pc@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=sohaib.amhmd@gmail.com \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).