From: Thomas Veerman Date: Wed, 2 Jan 2013 13:41:36 +0000 (+0000) Subject: Add stack trace dumps for VFS over serial X-Git-Tag: v3.2.1~123 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/mdoc.3.txt?a=commitdiff_plain;h=ea8ff9284a77ff625d81d16f4a66212730071aee;p=minix.git Add stack trace dumps for VFS over serial --- diff --git a/kernel/arch/i386/arch_system.c b/kernel/arch/i386/arch_system.c index 14ce73e06..2c5e0931e 100644 --- a/kernel/arch/i386/arch_system.c +++ b/kernel/arch/i386/arch_system.c @@ -45,6 +45,8 @@ static int osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */ void * k_stacks; static void ser_debug(int c); +static void ser_dump_vfs(void); + #ifdef CONFIG_SMP static void ser_dump_proc_cpu(void); #endif @@ -391,6 +393,9 @@ static void ser_debug(const int c) ser_dump_proc_cpu(); break; #endif + case '5': + ser_dump_vfs(); + break; #if DEBUG_TRACE #define TOGGLECASE(ch, flag) \ case ch: { \ @@ -428,6 +433,14 @@ void ser_dump_proc() } } +static void ser_dump_vfs() +{ + /* Notify VFS it has to generate stack traces. Kernel can't do that as + * it's not aware of user space threads. + */ + mini_notify(proc_addr(KERNEL), VFS_PROC_NR); +} + #ifdef CONFIG_SMP static void ser_dump_proc_cpu(void) { diff --git a/servers/vfs/main.c b/servers/vfs/main.c index 249fb5259..1ba96cfba 100644 --- a/servers/vfs/main.c +++ b/servers/vfs/main.c @@ -112,6 +112,8 @@ int main(void) /* A task notify()ed us */ if (who_e == DS_PROC_NR) handle_work(ds_event); + else if (who_e == KERNEL) + mthread_stacktraces(); else if (fp != NULL && (fp->fp_flags & FP_SRV_PROC)) handle_work(do_dev_event); else