. vfs: use it to dump threads stacks
Change-Id: I7ae3521fc153a407505f11049629e6d4142cf7c7
#include "syslib.h"
+void panic_hook(void);
+
+__weak_alias(panic_hook, __panic_hook);
+
+void __panic_hook(void)
+{
+ ;
+}
+
/*===========================================================================*
* panic *
*===========================================================================*/
printf("syslib:panic.c: stacktrace: ");
util_stacktrace();
+ panic_hook();
+
/* Try exit */
_exit(1);
thread_cleanup(NULL);
return(NULL);
}
+
+/* A function to be called on panic(). */
+void panic_hook(void)
+{
+ printf("VFS mthread stacktraces:\n");
+ mthread_stacktraces();
+}