| 1 |
// Copyright (C) 2012 Red Hat Inc., Bryn M. Reeves <[email protected]> |
| 2 |
// |
| 3 |
// This file is part of systemtap, and is free software. You can |
| 4 |
// redistribute it and/or modify it under the terms of the GNU General |
| 5 |
// Public License (GPL); either version 2, or (at your option) any |
| 6 |
// later version. |
| 7 |
// |
| 8 |
|
| 9 |
// <tapsetdescription> |
| 10 |
// Functions in the panic tapset allow a probe handler to invoke |
| 11 |
// the system panic routine with a user-specified message. |
| 12 |
// |
| 13 |
// This may be used with a crash dump collection facility such as |
| 14 |
// kexec/kdump in order to capture data for post-mortem debugging. |
| 15 |
// |
| 16 |
// Due to the fact that this will bring the system to an immediate |
| 17 |
// halt the functions in this tapset require guru mode. |
| 18 |
// </tapsetdescription> |
| 19 |
|
| 20 |
/** |
| 21 |
* sfunction panic - trigger a panic |
| 22 |
* @msg: message to pass to kernel's panic() function |
| 23 |
* |
| 24 |
* Description: This function triggers an immediate panic of the running |
| 25 |
* kernel with a user-specified panic message. |
| 26 |
* It requires guru mode. |
| 27 |
*/ |
| 28 |
function panic(msg:string) %{ |
| 29 |
/* guru */ /* unmodified-fnargs */ |
| 30 |
panic("%s", STAP_ARG_msg); |
| 31 |
%} |
| 32 |
|