summaryrefslogtreecommitdiffstats
path: root/src/vpp
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-05-16 09:08:14 -0400
committerDave Barach <dave@barachs.net>2017-05-16 09:09:48 -0400
commit814813103bb4acb9ced39c22972bd5e97df13d33 (patch)
tree59b0ba5329ccd8687f0dd26796331de7e0c49902 /src/vpp
parent92a838b14a1862ef07c631412069e968f303639b (diff)
VPP-845: add configurable elog post-mortem dump
Off by default. Enable via cmdline "... vlib { elog-post-mortem-dump } ..." Change-Id: I2056b9de9b37475f2bfeeb5404da838f1b42645a Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vpp')
-rw-r--r--src/vpp/vnet/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c
index d6a12325..ade32aa1 100644
--- a/src/vpp/vnet/main.c
+++ b/src/vpp/vnet/main.c
@@ -253,11 +253,13 @@ plugin_path_config (vlib_main_t * vm, unformat_input_t * input)
VLIB_CONFIG_FUNCTION (plugin_path_config, "plugin_path");
void vl_msg_api_post_mortem_dump (void);
+void elog_post_mortem_dump (void);
void
os_panic (void)
{
vl_msg_api_post_mortem_dump ();
+ elog_post_mortem_dump ();
abort ();
}
@@ -280,6 +282,7 @@ os_exit (int code)
recursion_block = 1;
vl_msg_api_post_mortem_dump ();
+ elog_post_mortem_dump ();
vhost_user_unmap_all ();
abort ();
}
@@ -320,6 +323,12 @@ test_crash_command_fn (vlib_main_t * vm,
{
u64 *p = (u64 *) 0xdefec8ed;
+ ELOG_TYPE_DECLARE (e) =
+ {
+ .format = "deliberate crash: touching %x",.format_args = "i4",};
+
+ elog (&vm->elog_main, &e, 0xdefec8ed);
+
*p = 0xdeadbeef;
/* Not so much... */