]> Pileus Git - ~andy/linux/commitdiff
xtensa: add irq flags trace support
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 31 Mar 2013 02:32:42 +0000 (06:32 +0400)
committerChris Zankel <chris@zankel.net>
Thu, 9 May 2013 08:07:11 +0000 (01:07 -0700)
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
arch/xtensa/Kconfig
arch/xtensa/kernel/entry.S

index 13280f2780c859a330aca32ec3562bef394939cd..3eb543eacaa0acf9c688b2837c56413510c496e8 100644 (file)
@@ -55,6 +55,9 @@ source "kernel/Kconfig.freezer"
 config STACKTRACE_SUPPORT
        def_bool y
 
+config TRACE_IRQFLAGS_SUPPORT
+       def_bool y
+
 config MMU
        def_bool n
 
index 63845f950792ce86f3acfa2f4d93d858171d8d0f..3729b48d798ddec9d84583d14ec14b7086410b58 100644 (file)
@@ -389,6 +389,22 @@ common_exception:
 
        save_xtregs_opt a1 a2 a4 a5 a6 a7 PT_XTREGS_OPT
        
+#ifdef CONFIG_TRACE_IRQFLAGS
+       l32i    a4, a1, PT_DEPC
+       /* Double exception means we came here with an exception
+        * while PS.EXCM was set, i.e. interrupts disabled.
+        */
+       bgeui   a4, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f
+       l32i    a4, a1, PT_EXCCAUSE
+       bnei    a4, EXCCAUSE_LEVEL1_INTERRUPT, 1f
+       /* We came here with an interrupt means interrupts were enabled
+        * and we've just disabled them.
+        */
+       movi    a4, trace_hardirqs_off
+       callx4  a4
+1:
+#endif
+
        /* Go to second-level dispatcher. Set up parameters to pass to the
         * exception handler and call the exception handler.
         */
@@ -407,6 +423,22 @@ common_exception:
        .global common_exception_return
 common_exception_return:
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+       l32i    a4, a1, PT_DEPC
+       /* Double exception means we came here with an exception
+        * while PS.EXCM was set, i.e. interrupts disabled.
+        */
+       bgeui   a4, VALID_DOUBLE_EXCEPTION_ADDRESS, 1f
+       l32i    a4, a1, PT_EXCCAUSE
+       bnei    a4, EXCCAUSE_LEVEL1_INTERRUPT, 1f
+       /* We came here with an interrupt means interrupts were enabled
+        * and we'll reenable them on return.
+        */
+       movi    a4, trace_hardirqs_on
+       callx4  a4
+1:
+#endif
+
        /* Jump if we are returning from kernel exceptions. */
 
 1:     l32i    a3, a1, PT_PS