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: <6341384c-b3e6-fbe5-f29f-e0db114bd439@huawei.com>
Date:   Fri, 13 May 2022 16:29:03 +0100
From:   John Garry <john.garry@...wei.com>
To:     Ian Rogers <irogers@...gle.com>,
        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>,
        Jiri Olsa <jolsa@...nel.org>,
        "Namhyung Kim" <namhyung@...nel.org>,
        Riccardo Mancini <rickyman7@...il.com>,
        "Sohaib Mohamed" <sohaib.amhmd@...il.com>,
        Carsten Haitzler <carsten.haitzler@....com>,
        Marco Elver <elver@...gle.com>,
        Michael Petlan <mpetlan@...hat.com>,
        <linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 1/7] perf test: Skip reason for suites with 1 test

On 13/05/2022 05:05, Ian Rogers wrote:
> When a suite has just 1 subtest, the subtest number is given as -1 to
> avoid indented printing. When this subtest number is seen for the skip
> reason, use the reason of the first test.
> 
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
>   tools/perf/tests/builtin-test.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
> index fac3717d9ba1..33fcafa0fa79 100644
> --- a/tools/perf/tests/builtin-test.c
> +++ b/tools/perf/tests/builtin-test.c
> @@ -137,10 +137,10 @@ static bool has_subtests(const struct test_suite *t)
>   
>   static const char *skip_reason(const struct test_suite *t, int subtest)
>   {
> -	if (t->test_cases && subtest >= 0)
> -		return t->test_cases[subtest].skip_reason;
> +	if (!t->test_cases)
> +		return NULL;
>   
> -	return NULL;
> +	return t->test_cases[subtest >= 0 ? subtest : 0].skip_reason;
>   }

I was not sure which suite has a single tastcase, so I experimented for 
libpfm4 by deleting a testcase so it has only 1x remaining, I get:

before your change:
john@...alhost:~/acme/tools/perf> sudo ./perf test 63
63: Test libpfm4 support : Skip

after:

john@...alhost:~/acme/tools/perf> sudo ./perf test 63
63: Test libpfm4 support : Skip (not compiled in)

Although it is odd to have a single sub-test, is there a reason for 
which we don't print its name? We print the name when there are multiple 
sub-tests.

Thanks,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ