#include <linux/error-injection.h>
#include <linux/debugfs.h>
#include <linux/kallsyms.h>
#include <linux/kprobes.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <asm/sections.h>
static LIST_HEAD(error_injection_list);
static DEFINE_MUTEX(ei_mutex);
struct ei_entry { … };
bool within_error_injection_list(unsigned long addr)
{ … }
int get_injectable_error_type(unsigned long addr)
{ … }
static void populate_error_injection_list(struct error_injection_entry *start,
struct error_injection_entry *end,
void *priv)
{ … }
extern struct error_injection_entry __start_error_injection_whitelist[];
extern struct error_injection_entry __stop_error_injection_whitelist[];
static void __init populate_kernel_ei_list(void)
{ … }
#ifdef CONFIG_MODULES
static void module_load_ei_list(struct module *mod)
{ … }
static void module_unload_ei_list(struct module *mod)
{ … }
static int ei_module_callback(struct notifier_block *nb,
unsigned long val, void *data)
{ … }
static struct notifier_block ei_module_nb = …;
static __init int module_ei_init(void)
{ … }
#else
#define module_ei_init …
#endif
static void *ei_seq_start(struct seq_file *m, loff_t *pos)
{ … }
static void ei_seq_stop(struct seq_file *m, void *v)
{ … }
static void *ei_seq_next(struct seq_file *m, void *v, loff_t *pos)
{ … }
static const char *error_type_string(int etype)
{ … }
static int ei_seq_show(struct seq_file *m, void *v)
{ … }
static const struct seq_operations ei_sops = …;
DEFINE_SEQ_ATTRIBUTE(…);
static int __init ei_debugfs_init(void)
{ … }
static int __init init_error_injection(void)
{ … }
late_initcall(init_error_injection);