[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c4f7e14b-a229-6b23-b28d-880b8369e6d8@arm.com>
Date: Mon, 26 Sep 2022 16:06:24 +0100
From: James Clark <james.clark@....com>
To: Marco Elver <elver@...gle.com>, Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Ian Rogers <irogers@...gle.com>,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH] perf test: Skip sigtrap test on old kernels
On 03/09/2022 07:52, Marco Elver wrote:
> On Sat, 3 Sept 2022 at 02:02, Namhyung Kim <namhyung@...nel.org> wrote:
>>
>> If it runs on an old kernel, perf_event_open would fail because of the
>> new fields sigtrap and sig_data. Just skip the test if it failed.
>>
>> Cc: Marco Elver <elver@...gle.com>
>> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
>> ---
>> tools/perf/tests/sigtrap.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c
>> index e32ece90e164..7057566e6ae4 100644
>> --- a/tools/perf/tests/sigtrap.c
>> +++ b/tools/perf/tests/sigtrap.c
>> @@ -140,6 +140,7 @@ static int test__sigtrap(struct test_suite *test __maybe_unused, int subtest __m
>> fd = sys_perf_event_open(&attr, 0, -1, -1, perf_event_open_cloexec_flag());
>> if (fd < 0) {
>> pr_debug("FAILED sys_perf_event_open(): %s\n", str_error_r(errno, sbuf, sizeof(sbuf)));
>> + ret = TEST_SKIP;
>
> Wouldn't we be interested if perf_event_open() fails because it could
> actually be a bug? By skipping we'll be more likely to miss the fact
> there's a real problem.
>
> That's my naive thinking at least - what do other perf tests usually
> do in this case?
I missed this discussion but I just submitted a patch with a similar
issue [1]. To me, it doesn't make sense to have the tests pass on older
kernels if this lowers the value of the tests by accepting possibly
invalid values. If you want to test older kernels then just use older
tests, but maybe there is some use case that I'm not aware of.
[1]: "[PATCH 0/1] perf test: Fix attr tests for PERF_FORMAT_LOST"
>
> Thanks,
> -- Marco
Powered by blists - more mailing lists