selftests/perf_events: Add kselftest for process-wide sigtrap handling
authorMarco Elver <elver@google.com>
Thu, 8 Apr 2021 10:36:02 +0000 (12:36 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 16 Apr 2021 14:32:42 +0000 (16:32 +0200)
commitf2c3c32f45002de19c6dec33f32fd259e82f2557
tree24c5a38ded00afcf557e4cf67646b53224fd2cc9
parent97ba62b278674293762c3d91f724f1bb922f04e0
selftests/perf_events: Add kselftest for process-wide sigtrap handling

Add a kselftest for testing process-wide perf events with synchronous
SIGTRAP on events (using breakpoints). In particular, we want to test
that changes to the event propagate to all children, and the SIGTRAPs
are in fact synchronously sent to the thread where the event occurred.

Note: The "signal_stress" test case is also added later in the series to
perf tool's built-in tests. The test here is more elaborate in that
respect, which on one hand avoids bloating the perf tool unnecessarily,
but we also benefit from structured tests with TAP-compliant output that
the kselftest framework provides.

Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210408103605.1676875-8-elver@google.com
tools/testing/selftests/perf_events/.gitignore [new file with mode: 0644]
tools/testing/selftests/perf_events/Makefile [new file with mode: 0644]
tools/testing/selftests/perf_events/config [new file with mode: 0644]
tools/testing/selftests/perf_events/settings [new file with mode: 0644]
tools/testing/selftests/perf_events/sigtrap_threads.c [new file with mode: 0644]