Messages in this thread | | | From | Ian Rogers <> | Date | Mon, 22 Mar 2021 20:10:22 -0700 | Subject | Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec |
| |
On Mon, Mar 22, 2021 at 6:24 AM Marco Elver <elver@google.com> wrote: > > On Wed, Mar 10, 2021 at 11:41AM +0100, Marco Elver wrote: > > Add kselftest to test that remove_on_exec removes inherited events from > > child tasks. > > > > Signed-off-by: Marco Elver <elver@google.com> > > To make compatible with more recent libc, we'll need to fixup the tests > with the below. > > Also, I've seen that tools/perf/tests exists, however it seems to be > primarily about perf-tool related tests. Is this correct? > > I'd propose to keep these purely kernel ABI related tests separate, and > that way we can also make use of the kselftests framework which will > also integrate into various CI systems such as kernelci.org.
Perhaps there is a way to have both? Having the perf tool spot an errant kernel feels like a feature. There are also tools/lib/perf/tests and Vince Weaver's tests [1]. It is possible to run standalone tests from within perf test by having them be executed by a shell test.
Thanks, Ian
[1] https://github.com/deater/perf_event_tests
> Thanks, > -- Marco > > ------ >8 ------ > > diff --git a/tools/testing/selftests/perf_events/remove_on_exec.c b/tools/testing/selftests/perf_events/remove_on_exec.c > index e176b3a74d55..f89d0cfdb81e 100644 > --- a/tools/testing/selftests/perf_events/remove_on_exec.c > +++ b/tools/testing/selftests/perf_events/remove_on_exec.c > @@ -13,6 +13,11 @@ > #define __have_siginfo_t 1 > #define __have_sigval_t 1 > #define __have_sigevent_t 1 > +#define __siginfo_t_defined > +#define __sigval_t_defined > +#define __sigevent_t_defined > +#define _BITS_SIGINFO_CONSTS_H 1 > +#define _BITS_SIGEVENT_CONSTS_H 1 > > #include <linux/perf_event.h> > #include <pthread.h> > diff --git a/tools/testing/selftests/perf_events/sigtrap_threads.c b/tools/testing/selftests/perf_events/sigtrap_threads.c > index 7ebb9bb34c2e..b9a7d4b64b3c 100644 > --- a/tools/testing/selftests/perf_events/sigtrap_threads.c > +++ b/tools/testing/selftests/perf_events/sigtrap_threads.c > @@ -13,6 +13,11 @@ > #define __have_siginfo_t 1 > #define __have_sigval_t 1 > #define __have_sigevent_t 1 > +#define __siginfo_t_defined > +#define __sigval_t_defined > +#define __sigevent_t_defined > +#define _BITS_SIGINFO_CONSTS_H 1 > +#define _BITS_SIGEVENT_CONSTS_H 1 > > #include <linux/hw_breakpoint.h> > #include <linux/perf_event.h>
| |