linux/lib/test_fprobe.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * test_fprobe.c - simple sanity test for fprobe
 */

#include <linux/kernel.h>
#include <linux/fprobe.h>
#include <linux/random.h>
#include <kunit/test.h>

#define div_factor

static struct kunit *current_test;

static u32 rand1, entry_val, exit_val;

/* Use indirect calls to avoid inlining the target functions */
static u32 (*target)(u32 value);
static u32 (*target2)(u32 value);
static u32 (*target_nest)(u32 value, u32 (*nest)(u32));
static unsigned long target_ip;
static unsigned long target2_ip;
static unsigned long target_nest_ip;
static int entry_return_value;

static noinline u32 fprobe_selftest_target(u32 value)
{}

static noinline u32 fprobe_selftest_target2(u32 value)
{}

static noinline u32 fprobe_selftest_nest_target(u32 value, u32 (*nest)(u32))
{}

static notrace int fp_entry_handler(struct fprobe *fp, unsigned long ip,
				    unsigned long ret_ip,
				    struct pt_regs *regs, void *data)
{}

static notrace void fp_exit_handler(struct fprobe *fp, unsigned long ip,
				    unsigned long ret_ip,
				    struct pt_regs *regs, void *data)
{}

static notrace int nest_entry_handler(struct fprobe *fp, unsigned long ip,
				      unsigned long ret_ip,
				      struct pt_regs *regs, void *data)
{}

static notrace void nest_exit_handler(struct fprobe *fp, unsigned long ip,
				      unsigned long ret_ip,
				      struct pt_regs *regs, void *data)
{}

/* Test entry only (no rethook) */
static void test_fprobe_entry(struct kunit *test)
{}

static void test_fprobe(struct kunit *test)
{}

static void test_fprobe_syms(struct kunit *test)
{}

/* Test private entry_data */
static void test_fprobe_data(struct kunit *test)
{}

/* Test nr_maxactive */
static void test_fprobe_nest(struct kunit *test)
{}

static void test_fprobe_skip(struct kunit *test)
{}

static unsigned long get_ftrace_location(void *func)
{}

static int fprobe_test_init(struct kunit *test)
{}

static struct kunit_case fprobe_testcases[] =;

static struct kunit_suite fprobe_test_suite =;

kunit_test_suites();