#include <kunit/test.h>
#include <linux/cpumask.h>
#include <linux/hw_breakpoint.h>
#include <linux/kthread.h>
#include <linux/perf_event.h>
#include <asm/hw_breakpoint.h>
#define TEST_REQUIRES_BP_SLOTS(test, slots) …
#define TEST_EXPECT_NOSPC(expr) …
#define MAX_TEST_BREAKPOINTS …
static char break_vars[MAX_TEST_BREAKPOINTS];
static struct perf_event *test_bps[MAX_TEST_BREAKPOINTS];
static struct task_struct *__other_task;
static struct perf_event *register_test_bp(int cpu, struct task_struct *tsk, int idx)
{ … }
static void unregister_test_bp(struct perf_event **bp)
{ … }
static int get_test_bp_slots(void)
{ … }
static void fill_one_bp_slot(struct kunit *test, int *id, int cpu, struct task_struct *tsk)
{ … }
static bool fill_bp_slots(struct kunit *test, int *id, int cpu, struct task_struct *tsk, int skip)
{ … }
static int dummy_kthread(void *arg)
{ … }
static struct task_struct *get_other_task(struct kunit *test)
{ … }
static int get_test_cpu(int num)
{ … }
static void test_one_cpu(struct kunit *test)
{ … }
static void test_many_cpus(struct kunit *test)
{ … }
static void test_one_task_on_all_cpus(struct kunit *test)
{ … }
static void test_two_tasks_on_all_cpus(struct kunit *test)
{ … }
static void test_one_task_on_one_cpu(struct kunit *test)
{ … }
static void test_one_task_mixed(struct kunit *test)
{ … }
static void test_two_tasks_on_one_cpu(struct kunit *test)
{ … }
static void test_two_tasks_on_one_all_cpus(struct kunit *test)
{ … }
static void test_task_on_all_and_one_cpu(struct kunit *test)
{ … }
static struct kunit_case hw_breakpoint_test_cases[] = …;
static int test_init(struct kunit *test)
{ … }
static void test_exit(struct kunit *test)
{ … }
static struct kunit_suite hw_breakpoint_test_suite = …;
kunit_test_suites(…);
MODULE_AUTHOR(…) …;