Move struct stkmon_save_s to apps/include/system/utils.h
authorjc_.kim <jc_.kim@samsung.com>
Fri, 4 Aug 2017 04:01:04 +0000 (13:01 +0900)
committerjc_.kim <jc_.kim@samsung.com>
Fri, 4 Aug 2017 04:04:30 +0000 (13:04 +0900)
apps/include/system/utils.h
apps/system/utils/kdbg_stackmonitor.c

index 4c97aac..4efe1a5 100644 (file)
 #define __APPS_INCLUDE_SYSTEM_UTILS_H
 #include <tinyara/config.h>
 
+#ifdef CONFIG_ENABLE_STACKMONITOR
+#include <tinyara/clock.h>
+#include <sys/types.h>
+
+struct stkmon_save_s {
+       systime_t timestamp;
+       pid_t chk_pid;
+       size_t chk_stksize;
+       size_t chk_peaksize;
+#ifdef CONFIG_DEBUG_MM_HEAPINFO
+       int chk_peakheap;
+#endif
+#if (CONFIG_TASK_NAME_SIZE > 0)
+       char chk_name[CONFIG_TASK_NAME_SIZE + 1];
+#endif
+};
+#endif
+
 #ifdef CONFIG_TASH
 #ifdef CONFIG_KERNEL_CMDS
 void kernel_register_utilcmds(void);
index fba81de..ea49bb0 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/types.h>
+#include <stdint.h>
 #include <sched.h>
 #include <pthread.h>
 #include <errno.h>
 #include <tinyara/arch.h>
-#include <tinyara/clock.h>
 #include <tinyara/sched.h>
+#include <apps/system/utils.h>
 
 /****************************************************************************
  * Pre-processor Definitions
 #ifndef CONFIG_STACKMONITOR_INTERVAL
 #define CONFIG_STACKMONITOR_INTERVAL 5
 #endif
-
 extern const uint32_t g_idle_topstack;
 /****************************************************************************
  * Private Types
  ****************************************************************************/
-struct stkmon_save_s {
-       systime_t timestamp;
-       pid_t chk_pid;
-       size_t chk_stksize;
-       size_t chk_peaksize;
-#ifdef CONFIG_DEBUG_MM_HEAPINFO
-       int chk_peakheap;
-#endif
-#if (CONFIG_TASK_NAME_SIZE > 0)
-       char chk_name[CONFIG_TASK_NAME_SIZE + 1];
-#endif
-};
 
 /****************************************************************************
  * Private Data