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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fXFESx7_+CY-QMnaZSkPSxTGFqwr1eKhHmTbEJoYeMTvQ@mail.gmail.com>
Date: Tue, 1 Jul 2025 08:51:53 -0700
From: Ian Rogers <irogers@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>, Kan Liang <kan.liang@...ux.intel.com>, 
	Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>, 
	Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>, 
	LKML <linux-kernel@...r.kernel.org>, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 1/3] perf test: Check test suite description only

On Mon, Jun 30, 2025 at 4:32 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> Currently perf test checks the given string with descriptions for both
> test suites and cases (subtests).  But sometimes it's confusing since
> the subtests don't contain the important keyword.
>
> I think it's better to check the suite level and run the whole suite
> together.
>
> Before:
>   $ perf test hwmon
>   (no output)
>
> After:
>   $ perf test hwmon
>    10: Hwmon PMU                                                       :
>    10.1: Basic parsing test                                            : Ok
>    10.2: Parsing without PMU name                                      : Ok
>    10.3: Parsing with PMU name                                         : Ok

This is better, thanks!

> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  tools/perf/tests/builtin-test.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
> index 80375ca39a37a256..dfaff4185eb05a1a 100644
> --- a/tools/perf/tests/builtin-test.c
> +++ b/tools/perf/tests/builtin-test.c
> @@ -567,10 +567,6 @@ static int __cmd_test(struct test_suite **suites, int argc, const char *argv[],
>
>                         for (unsigned int run = 0; run < runs_per_test; run++) {
>                                 test_suite__for_each_test_case(*t, curr_test_case) {
> -                                       if (!perf_test__matches(test_description(*t, curr_test_case),
> -                                                               curr_suite, argc, argv))
> -                                               continue;
> -

This will change the behavior so that if a sub-test matches but the
test suite as a whole doesn't the whole test suite will now be run.
For example:

```
$ perf test list
...
 39: CPU map
39.1: Synthesize cpu map
39.2: Print cpu map
39.3: Merge cpu map
39.4: Intersect cpu map
39.5: Equal cpu map
...
$ perf test -v "Equal cpu map"
39.5: Equal cpu map                                                 : Ok
```

whereas with this change the whole of the "CPU map" test suite will be
run. I think the condition:

```
if (!perf_test__matches(test_description(*t, curr_test_case),
curr_suite, argc, argv))
```

should  be:

```
if (!perf_test__matches(test_description(*t, curr_test_case),
curr_suite, argc, argv) &&
    !perf_test__matches(test_description(*t, -1), curr_suite, argc, argv))
```

But you could avoid computing the extra perf_test__matches with a
boolean as that test is done immediately before.

Thanks,
Ian

>                                         err = start_test(*t, curr_suite, curr_test_case,
>                                                          &child_tests[child_test_num++],
>                                                          width, pass);
> --
> 2.50.0.727.gbf7dc18ff4-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ