From 8da1eb9f7ac0518f79af2d76310e7090f0e95d90 Mon Sep 17 00:00:00 2001
From: MohmadAyman <no.future2e1@gmail.com>
Date: Wed, 1 Jun 2016 20:40:08 +0200
Subject: [PATCH] ps: provide ISR stackusage information

---
 cpu/x86/x86_thread_arch.c |  2 +-
 sys/ps/ps.c               | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/cpu/x86/x86_thread_arch.c b/cpu/x86/x86_thread_arch.c
index a06c8d68e5..bcd494d150 100644
--- a/cpu/x86/x86_thread_arch.c
+++ b/cpu/x86/x86_thread_arch.c
@@ -13,7 +13,7 @@
  * @author  Martine Lenders <mlenders@inf.fu-berlin.de>
  */
 
-#include "thread_arch.h"
+#include "arch/thread_arch.h"
 
 /* This function calculates the ISR_usage */
 int thread_arch_isr_stack_usage(void)
diff --git a/sys/ps/ps.c b/sys/ps/ps.c
index 6dc005d501..9b64c6f4e7 100644
--- a/sys/ps/ps.c
+++ b/sys/ps/ps.c
@@ -71,6 +71,16 @@ void ps(void)
 #endif
            "state");
 
+#ifdef DEVELHELP
+    int isr_usage = thread_arch_isr_stack_usage();                                 /* ISR stack usage */
+    printf("\t  - | isr_stack            | -        - |"
+           "   - | %5i (%5i) | -\n", ISR_STACKSIZE, isr_usage);
+    overall_stacksz += ISR_STACKSIZE;
+    if (isr_usage > 0) {
+        overall_used += isr_usage;
+    }
+#endif
+
     for (kernel_pid_t i = KERNEL_PID_FIRST; i <= KERNEL_PID_LAST; i++) {
         thread_t *p = (thread_t *)sched_threads[i];
 
-- 
GitLab