]> Zhao Yanbai Git Server - minix.git/commitdiff
Add stack trace dumps for VFS over serial
authorThomas Veerman <thomas@minix3.org>
Wed, 2 Jan 2013 13:41:36 +0000 (13:41 +0000)
committerThomas Veerman <thomas@minix3.org>
Fri, 11 Jan 2013 09:18:36 +0000 (09:18 +0000)
kernel/arch/i386/arch_system.c
servers/vfs/main.c

index 14ce73e0604caee23cb25680ca155cdda022991e..2c5e0931e7431f927b44c47b8145d4264267da52 100644 (file)
@@ -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)
 {
index 249fb52593ad5da913650b96db49fcc5a4b988af..1ba96cfbaddf72377cffe1abd0078a04ae2de555 100644 (file)
@@ -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