kernel: gather basic thread runtime statistics
This adds the bits to gather the first thread runtime statictic:
thread execution time. It provides a rough idea of how much time
a thread is spent in active execution. Currently it is not being
used, pending following commits where it combines with the trace
points on context switch as they instrument the same locations.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
diff --git a/kernel/include/kernel_internal.h b/kernel/include/kernel_internal.h
index 277cea7..a77935d 100644
--- a/kernel/include/kernel_internal.h
+++ b/kernel/include/kernel_internal.h
@@ -155,6 +155,18 @@
extern int z_gdb_main_loop(struct gdb_ctx *ctx, bool start);
#endif
+#ifdef CONFIG_THREAD_RUNTIME_STATS
+void z_thread_mark_switched_in(void);
+void z_thread_mark_switched_out(void);
+#else
+static inline void z_thread_mark_switched_in(void)
+{
+}
+
+static inline void z_thread_mark_switched_out(void)
+{
+}
+#endif
#ifdef __cplusplus
}