FILE
reactor_panic.c
File preview with syntax highlighting.
linux-6.19.14/kernel/trace/rv/reactor_panic.c
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <bristot@kernel.org> 4 * 5 * Panic RV reactor: 6 * Prints the exception msg to the kernel message log and panic(). 7 */ 8 9#include <linux/ftrace.h> 10#include <linux/tracepoint.h> 11#include <linux/kernel.h> 12#include <linux/module.h> 13#include <linux/init.h> 14#include <linux/rv.h> 15 16__printf(1, 0) static void rv_panic_reaction(const char *msg, va_list args) 17{ 18 vpanic(msg, args); 19} 20 21static struct rv_reactor rv_panic = { 22 .name = "panic", 23 .description = "panic the system if an exception is found.", 24 .react = rv_panic_reaction 25}; 26 27static int __init register_react_panic(void) 28{ 29 rv_register_reactor(&rv_panic); 30 return 0; 31} 32 33static void __exit unregister_react_panic(void) 34{ 35 rv_unregister_reactor(&rv_panic); 36} 37 38module_init(register_react_panic); 39module_exit(unregister_react_panic); 40 41MODULE_AUTHOR("Daniel Bristot de Oliveira"); 42MODULE_DESCRIPTION("panic rv reactor: panic if an exception is found.");
~/
Read-only file preview.