lkml.org 
[lkml]   [2022]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf test: Skip sigtrap test on old kernels
Em Sat, Sep 03, 2022 at 08:52:01AM +0200, Marco Elver escreveu:
> On Sat, 3 Sept 2022 at 02:02, Namhyung Kim <namhyung@kernel.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@google.com>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.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?

Yeah, I was going to try and check if this is the only way that, with
the given arguments, perf_event_open would fail, but its better to at
least check errno against -EINVAL or something?

- Arnaldo

\
 
 \ /
  Last update: 2022-09-06 14:46    [W:0.107 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site