1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <bristot@kernel.org>
6 * Prints the exception msg to the kernel message log.
8 #include <linux/ftrace.h>
9 #include <linux/tracepoint.h>
10 #include <linux/kernel.h>
11 #include <linux/module.h>
12 #include <linux/init.h>
15 static void rv_printk_reaction(char *msg)
20 static struct rv_reactor rv_printk = {
22 .description = "prints the exception msg to the kernel message log.",
23 .react = rv_printk_reaction
26 static int __init register_react_printk(void)
28 rv_register_reactor(&rv_printk);
32 static void __exit unregister_react_printk(void)
34 rv_unregister_reactor(&rv_printk);
37 module_init(register_react_printk);
38 module_exit(unregister_react_printk);
40 MODULE_AUTHOR("Daniel Bristot de Oliveira");
41 MODULE_DESCRIPTION("printk rv reactor: printk if an exception is hit.");