linux/lib/test_dynamic_debug.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Kernel module for testing dynamic_debug
 *
 * Authors:
 *      Jim Cromie	<[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/module.h>

/* run tests by reading or writing sysfs node: do_prints */

static void do_prints(void); /* device under test */
static int param_set_do_prints(const char *instr, const struct kernel_param *kp)
{}
static int param_get_do_prints(char *buffer, const struct kernel_param *kp)
{}
static const struct kernel_param_ops param_ops_do_prints =;
module_param_cb();

/*
 * Using the CLASSMAP api:
 * - classmaps must have corresponding enum
 * - enum symbols must match/correlate with class-name strings in the map.
 * - base must equal enum's 1st value
 * - multiple maps must set their base to share the 0-30 class_id space !!
 *   (build-bug-on tips welcome)
 * Additionally, here:
 * - tie together sysname, mapname, bitsname, flagsname
 */
#define DD_SYS_WRAP(_model, _flags)

/* numeric input, independent bits */
enum cat_disjoint_bits {};
DECLARE_DYNDBG_CLASSMAP();
DD_SYS_WRAP();
DD_SYS_WRAP();

/* symbolic input, independent bits */
enum cat_disjoint_names {};
DECLARE_DYNDBG_CLASSMAP();
DD_SYS_WRAP();
DD_SYS_WRAP();

/* numeric verbosity, V2 > V1 related */
enum cat_level_num {};
DECLARE_DYNDBG_CLASSMAP();
DD_SYS_WRAP();
DD_SYS_WRAP();

/* symbolic verbosity */
enum cat_level_names {};
DECLARE_DYNDBG_CLASSMAP();
DD_SYS_WRAP();
DD_SYS_WRAP();

/* stand-in for all pr_debug etc */
#define prdbg(SYM)

static void do_cats(void)
{}

static void do_levels(void)
{}

static void do_prints(void)
{}

static int __init test_dynamic_debug_init(void)
{}

static void __exit test_dynamic_debug_exit(void)
{}

module_init();
module_exit(test_dynamic_debug_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();