sysview: Add support to trace user-defined events
SysView can now be used to trace/profile any user-defined events.
Event identifier is any number selected by user - SysView client will
match start/stop traces for each identifier and display execution time
as well as run count.
@@ -150,6 +150,18 @@ os_trace_idle(void)
SEGGER_SYSVIEW_OnIdle();
}
+static inline void
+os_trace_user_start(unsigned id)
+{
+ SEGGER_SYSVIEW_OnUserStart(id);
+}
+
+static inline void
+os_trace_user_stop(unsigned id)
+{
+ SEGGER_SYSVIEW_OnUserStop(id);
+}
+
#endif /* MYNEWT_VAL(OS_SYSVIEW) */
#if MYNEWT_VAL(OS_SYSVIEW) && !defined(OS_TRACE_DISABLE_FILE_API)
@@ -239,6 +251,16 @@ os_trace_idle(void)
{
}
+static inline void
+os_trace_user_start(unsigned id)
+{
+}
+
+static inline void
+os_trace_user_stop(unsigned id)
+{
+}
+
#endif /* !MYNEWT_VAL(OS_SYSVIEW) */
#if !MYNEWT_VAL(OS_SYSVIEW) || defined(OS_TRACE_DISABLE_FILE_API)
