Profiler: Add profiling support in NSPE
Signed-off-by: Jianliang Shen <jianliang.shen@arm.com>
Change-Id: Iac59d76d0ea61d90ebf0ddc61e53e16d0606e1a6
diff --git a/app/main_ns.c b/app/main_ns.c
index 75f85cf..8793148 100644
--- a/app/main_ns.c
+++ b/app/main_ns.c
@@ -24,6 +24,9 @@
#if (CONFIG_TFM_FLOAT_ABI >= 1)
#include "cmsis.h"
#endif
+#ifdef CONFIG_TFM_ENALBE_PROFILING
+#include "tfm_ns_profiling.h"
+#endif
/**
* \brief Modified table template for user defined SVC functions
@@ -45,6 +48,20 @@
#endif
#endif
+#ifdef CONFIG_TFM_ENALBE_PROFILING
+
+#if TFM_NS_REG_TEST || PSA_API_TEST_NS
+#error "TF-M NS profiling shall not run together with NS regression tests"
+#endif
+/**
+ * \brief List of Profiling thread attributes
+ */
+const osThreadAttr_t thread_attr = {
+ .name = "profiling_thread",
+ .stack_size = 4096U,
+};
+osThreadFunc_t thread_func = tfm_ns_profiling;
+#else
/**
* \brief List of RTOS thread attributes
*/
@@ -58,6 +75,7 @@
* main thread
*/
static osThreadFunc_t thread_func = test_app;
+#endif
#ifdef TFM_MULTI_CORE_NS_OS_MAILBOX_THREAD
static osThreadFunc_t mailbox_thread_func = tfm_ns_mailbox_thread_runner;