lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YVDiMDoD2dr312KY@krava>
Date:   Sun, 26 Sep 2021 23:12:16 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Jin Yao <yao.jin@...ux.intel.com>,
        John Garry <john.garry@...wei.com>,
        "Paul A . Clarke" <pc@...ibm.com>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        Brendan Higgins <brendanhiggins@...gle.com>,
        Daniel Latypov <dlatypov@...gle.com>,
        David Gow <davidgow@...gle.com>, eranian@...gle.com
Subject: Re: [RFC PATCH 3/5] perf test: Make each test/suite its own struct.

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 <irogers@...gle.com>
> ---
>  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ