Skip to content

ktests wiki: breakpoints: basic description, compilation tips #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

pvts-mat
Copy link
Contributor

Another tests collection to expose: breakpoints.

TLDR: There are only two tests. The step_after_suspend_test won't work when run in qemu so it can (and should) be skipped. The breakpoint_test (and its arm64 equivalent breakpoint_test_arm64) has some compilation gimmicks but once built it should run fine and always pass. Moreover, it's testing a rather important functionality of the kernel as well as being quick and straightforward, so it's a good candidate to be included in the sanity checks.

Sidenote

I'll need to systematize this effort a bit or nothing productive will come out of it as there are too many tests (~200-300) and at the current speed dictated by the stolen time between CVEs covering them all will take me years.

The overarching goal is to define a good sanity check tests suite.

For this it makes sense to pick the tests in the order of how essential the subsystems are which they test. In this way a good sanity tests suite should be found way before all the tests are examined. Finding out which tests are essential is part of examining them though, so I'll use a small heuristic and research the tests in the order of when they were introduced to the code base chronologically. Hopefully the kernel devs were testing the essential features first, too.

Here's a table of all makefiles from the tools/testing/selftests/ trunk, ordered by their creation commit date. It should be of use if anyone else wished to join the effort of examining the selftests so that we know what we're actually doing:

| Makefile                                                                           | Date       |
|------------------------------------------------------------------------------------+------------|
| tools/testing/selftests/Makefile                                                   | 2012-01-12 |
| tools/testing/selftests/breakpoints/Makefile                                       | 2012-01-12 |
| tools/testing/selftests/kcmp/Makefile                                              | 2012-05-31 |
| tools/testing/selftests/mqueue/Makefile                                            | 2012-05-31 |
| tools/testing/selftests/cpu-hotplug/Makefile                                       | 2012-07-30 |
| tools/testing/selftests/memory-hotplug/Makefile                                    | 2012-07-30 |
| tools/testing/selftests/ipc/Makefile                                               | 2013-01-04 |
| tools/testing/selftests/efivarfs/Makefile                                          | 2013-02-27 |
| tools/testing/selftests/net/Makefile                                               | 2013-03-20 |
| tools/testing/selftests/ptrace/Makefile                                            | 2013-04-30 |
| tools/testing/selftests/timers/Makefile                                            | 2013-07-03 |
| tools/testing/selftests/powerpc/Makefile                                           | 2013-08-14 |
| tools/testing/selftests/powerpc/pmu/Makefile                                       | 2013-08-14 |
| tools/testing/selftests/user/Makefile                                              | 2014-01-23 |
| tools/testing/selftests/powerpc/copyloops/Makefile                                 | 2014-03-07 |
| tools/testing/selftests/powerpc/mm/Makefile                                        | 2014-06-06 |
| tools/testing/selftests/sysctl/Makefile                                            | 2014-06-06 |
| tools/testing/selftests/powerpc/tm/Makefile                                        | 2014-06-11 |
| tools/testing/selftests/powerpc/pmu/ebb/Makefile                                   | 2014-06-11 |
| tools/testing/selftests/firmware/Makefile                                          | 2014-07-17 |
| tools/testing/selftests/mount/Makefile                                             | 2014-07-31 |
| tools/testing/selftests/memfd/Makefile                                             | 2014-08-08 |
| tools/testing/selftests/ftrace/Makefile                                            | 2014-09-23 |
| tools/testing/selftests/powerpc/primitives/Makefile                                | 2014-09-30 |
| tools/testing/selftests/size/Makefile                                              | 2014-12-03 |
| tools/testing/selftests/exec/Makefile                                              | 2014-12-13 |
| tools/testing/selftests/powerpc/stringloops/Makefile                               | 2015-01-23 |
| tools/testing/selftests/powerpc/vphn/Makefile                                      | 2015-03-18 |
| tools/testing/selftests/powerpc/switch_endian/Makefile                             | 2015-03-28 |
| tools/testing/selftests/x86/Makefile                                               | 2015-04-08 |
| tools/testing/selftests/futex/Makefile                                             | 2015-05-26 |
| tools/testing/selftests/futex/functional/Makefile                                  | 2015-05-26 |
| tools/testing/selftests/powerpc/dscr/Makefile                                      | 2015-06-07 |
| tools/testing/selftests/seccomp/Makefile                                           | 2015-06-17 |
| tools/testing/selftests/static_keys/Makefile                                       | 2015-08-03 |
| tools/testing/selftests/zram/Makefile                                              | 2015-08-27 |
| tools/testing/selftests/capabilities/Makefile                                      | 2015-09-04 |
| tools/testing/selftests/membarrier/Makefile                                        | 2015-09-11 |
| tools/testing/selftests/powerpc/benchmarks/Makefile                                | 2015-10-01 |
| tools/testing/selftests/powerpc/syscalls/Makefile                                  | 2015-10-15 |
| tools/testing/selftests/pstore/Makefile                                            | 2015-10-15 |
| tools/testing/selftests/lib/Makefile                                               | 2015-11-06 |
| tools/testing/selftests/intel_pstate/Makefile                                      | 2015-11-23 |
| tools/testing/selftests/media_tests/Makefile                                       | 2016-02-25 |
| tools/testing/selftests/powerpc/math/Makefile                                      | 2016-03-02 |
| tools/testing/selftests/sigaltstack/Makefile                                       | 2016-05-03 |
| tools/testing/selftests/powerpc/alignment/Makefile                                 | 2016-07-05 |
| tools/testing/selftests/filesystems/Makefile                                       | 2016-09-20 |
| tools/testing/selftests/vDSO/Makefile                                              | 2016-09-20 |
| tools/testing/selftests/ia64/Makefile                                              | 2016-09-20 |
| tools/testing/selftests/prctl/Makefile                                             | 2016-09-20 |
| tools/testing/selftests/watchdog/Makefile                                          | 2016-09-20 |
| tools/testing/selftests/ptp/Makefile                                               | 2016-09-20 |
| tools/testing/selftests/nsfs/Makefile                                              | 2016-09-22 |
| tools/testing/selftests/powerpc/signal/Makefile                                    | 2016-10-04 |
| tools/testing/selftests/bpf/Makefile                                               | 2016-10-18 |
| tools/testing/selftests/powerpc/ptrace/Makefile                                    | 2016-11-17 |
| tools/testing/selftests/sync/Makefile                                              | 2016-12-01 |
| tools/testing/selftests/gpio/Makefile                                              | 2016-12-13 |
| tools/testing/selftests/cpufreq/Makefile                                           | 2017-01-19 |
| tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/Makefile | 2017-01-25 |
| tools/testing/selftests/rcutorture/formal/srcu-cbmc/Makefile                       | 2017-01-25 |
| tools/testing/selftests/splice/Makefile                                            | 2017-02-18 |
| tools/testing/selftests/powerpc/cache_shape/Makefile                               | 2017-03-20 |
| tools/testing/selftests/kmod/Makefile                                              | 2017-07-14 |
| tools/testing/selftests/kvm/Makefile                                               | 2018-04-04 |
| tools/testing/selftests/proc/Makefile                                              | 2018-04-11 |
| tools/testing/selftests/uevent/Makefile                                            | 2018-05-23 |
| tools/testing/selftests/locking/Makefile                                           | 2018-05-30 |
| tools/testing/selftests/cgroup/Makefile                                            | 2018-05-30 |
| tools/testing/selftests/rtc/Makefile                                               | 2018-05-30 |
| tools/testing/selftests/sparc64/Makefile                                           | 2018-06-05 |
| tools/testing/selftests/sparc64/drivers/Makefile                                   | 2018-06-05 |
| tools/testing/selftests/rseq/Makefile                                              | 2018-06-06 |
| tools/testing/selftests/drivers/dma-buf/Makefile                                   | 2018-09-03 |
| tools/testing/selftests/powerpc/security/Makefile                                  | 2018-10-20 |
| tools/testing/selftests/ir/Makefile                                                | 2018-11-06 |
| tools/testing/selftests/netfilter/Makefile                                         | 2018-11-12 |
| tools/testing/selftests/livepatch/Makefile                                         | 2019-01-11 |
| tools/testing/selftests/filesystems/binderfs/Makefile                              | 2019-01-30 |
| tools/testing/selftests/tpm2/Makefile                                              | 2019-02-08 |
| tools/testing/selftests/safesetid/Makefile                                         | 2019-02-12 |
| tools/testing/selftests/pidfd/Makefile                                             | 2019-03-05 |
| tools/testing/selftests/tmpfs/Makefile                                             | 2019-03-05 |
| tools/testing/selftests/kexec/Makefile                                             | 2019-04-17 |
| tools/testing/selftests/rcutorture/Makefile                                        | 2019-05-28 |
| tools/testing/selftests/arm64/Makefile                                             | 2019-08-06 |
| tools/testing/selftests/powerpc/eeh/Makefile                                       | 2019-09-05 |
| tools/testing/selftests/clone3/Makefile                                            | 2019-10-21 |
| tools/testing/selftests/dmabuf-heaps/Makefile                                      | 2019-10-25 |
| tools/testing/selftests/arm64/tags/Makefile                                        | 2019-11-08 |
| tools/testing/selftests/arm64/signal/Makefile                                      | 2019-11-08 |
| tools/testing/selftests/filesystems/epoll/Makefile                                 | 2019-12-04 |
| tools/testing/selftests/wireguard/qemu/Makefile                                    | 2019-12-16 |
| tools/testing/selftests/lkdtm/Makefile                                             | 2020-01-10 |
| tools/testing/selftests/timens/Makefile                                            | 2020-01-14 |
| tools/testing/selftests/openat2/Makefile                                           | 2020-01-18 |
| tools/testing/selftests/net/mptcp/Makefile                                         | 2020-01-24 |
| tools/testing/selftests/resctrl/Makefile                                           | 2020-02-10 |
| tools/testing/selftests/net/forwarding/Makefile                                    | 2020-03-23 |
| tools/testing/selftests/pid_namespace/Makefile                                     | 2020-03-25 |
| tools/testing/selftests/powerpc/nx-gzip/Makefile                                   | 2020-04-21 |
| tools/testing/selftests/core/Makefile                                              | 2020-06-17 |
| tools/testing/selftests/fpu/Makefile                                               | 2020-06-29 |
| tools/testing/selftests/tc-testing/Makefile                                        | 2020-07-20 |
| tools/testing/selftests/mincore/Makefile                                           | 2020-08-07 |
| tools/testing/selftests/arm64/pauth/Makefile                                       | 2020-09-18 |
| tools/testing/selftests/arm64/fp/Makefile                                          | 2020-09-18 |
| tools/testing/selftests/arm64/mte/Makefile                                         | 2020-10-05 |
| tools/testing/selftests/sgx/Makefile                                               | 2020-11-18 |
| tools/testing/selftests/dma/Makefile                                               | 2020-11-27 |
| tools/testing/selftests/syscall_user_dispatch/Makefile                             | 2020-12-02 |
| tools/testing/selftests/bpf/bpf_testmod/Makefile                                   | 2020-12-03 |
| tools/testing/selftests/mount_setattr/Makefile                                     | 2021-01-24 |
| tools/testing/selftests/nci/Makefile                                               | 2021-01-29 |
| tools/testing/selftests/arm64/bti/Makefile                                         | 2021-03-24 |
| tools/testing/selftests/perf_events/Makefile                                       | 2021-04-16 |
| tools/testing/selftests/landlock/Makefile                                          | 2021-04-22 |
| tools/testing/selftests/rlimits/Makefile                                           | 2021-04-30 |
| tools/testing/selftests/sched/Makefile                                             | 2021-05-12 |
| tools/testing/selftests/damon/Makefile                                             | 2021-11-29 |
| tools/testing/selftests/powerpc/papr_attributes/Makefile                           | 2022-03-30 |
| tools/testing/selftests/powerpc/mce/Makefile                                       | 2022-04-07 |
| tools/testing/selftests/powerpc/pmu/sampling_tests/Makefile                        | 2022-05-26 |
| tools/testing/selftests/drivers/net/bonding/Makefile                               | 2022-12-08 |
| tools/testing/selftests/drivers/net/team/Makefile                                  | 2022-12-08 |
| tools/testing/selftests/tdx/Makefile                                               | 2023-01-19 |
| tools/testing/selftests/iommu/Makefile                                             | 2023-03-09 |
| tools/testing/selftests/hid/Makefile                                               | 2023-06-19 |
| tools/testing/selftests/net/hsr/Makefile                                           | 2023-07-26 |
| tools/testing/selftests/powerpc/dexcr/Makefile                                     | 2023-10-09 |
| tools/testing/selftests/tty/Makefile                                               | 2023-10-13 |
| tools/testing/selftests/mm/Makefile                                                | 2024-01-19 |

Copy link
Collaborator

@bmastbergen bmastbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌 Thanks!

Copy link
Collaborator

@PlaidCat PlaidCat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@PlaidCat PlaidCat merged commit d43d7d0 into ctrliq:main Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants