Gary-Hobson commented on code in PR #7984:
URL: https://github.com/apache/nuttx/pull/7984#discussion_r1059990402
##########
drivers/segger/sysview.c:
##########
@@ -365,63 +255,33 @@ void sched_note_irqhandler(int irq, FAR void *handler,
bool enter)
}
}
- g_sysview.irq[up_cpu_index()] = 0;
+ g_sysview_driver.irq[up_cpu_index()] = 0;
}
}
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void sched_note_syscall_enter(int nr, int argc, ...)
+static void sysview_syscall_enter(FAR struct note_driver_s *drv, int nr,
+ int argc, va_list *ap)
{
nr -= CONFIG_SYS_RESERVED;
-
- if (sysview_isenabled_syscall(nr) == 0)
- {
- return;
- }
-
- /* Set the name marker if the current syscall nr is not active */
-
- if (NOTE_FILTER_SYSCALLMASK_ISSET(nr, &g_sysview.syscall_marker) == 0)
- {
- /* Set the name marker */
-
- SEGGER_SYSVIEW_NameMarker(nr, g_funcnames[nr]);
-
- /* Mark the syscall active */
-
- NOTE_FILTER_SYSCALLMASK_SET(nr, &g_sysview.syscall_marker);
-
- /* Use the Syscall "0" to identify whether the syscall is enabled,
- * if the host tool is closed abnormally, use this bit to clear
- * the active set.
- */
-
- if (NOTE_FILTER_SYSCALLMASK_ISSET(0, &g_sysview.syscall_marker) == 0)
- {
- NOTE_FILTER_SYSCALLMASK_SET(0, &g_sysview.syscall_marker);
- }
- }
-
+ SEGGER_SYSVIEW_NameMarker(nr, g_funcnames[nr]);
Review Comment:
done
##########
include/nuttx/segger/sysview.h:
##########
@@ -25,18 +25,23 @@
* Included Files
****************************************************************************/
-#include <nuttx/config.h>
-#include <nuttx/sched.h>
+#include <nuttx/note/note_driver.h>
/****************************************************************************
- * Pre-processor Definitions
+ * Public Types
****************************************************************************/
-#ifdef CONFIG_SEGGER_SYSVIEW_PREFIX
-# define PREFIX(fun) sysview ## _ ## fun
-#else
-# define PREFIX(fun) fun
-#endif
+struct note_sysview_driver_s
Review Comment:
done
##########
drivers/segger/sysview.c:
##########
@@ -22,55 +22,94 @@
* Included Files
****************************************************************************/
-#include <nuttx/config.h>
-#include <syslog.h>
-
#include <nuttx/clock.h>
#include <nuttx/sched.h>
#include <nuttx/sched_note.h>
+#include <nuttx/note/note_driver.h>
#include <nuttx/segger/sysview.h>
+#include <stddef.h>
+#include <syslog.h>
#include <SEGGER_RTT.h>
#include <SEGGER_SYSVIEW.h>
#include "sched/sched.h"
/****************************************************************************
- * Private Types
+ * Private Functions
****************************************************************************/
-struct sysview_s
-{
- unsigned int irq[CONFIG_SMP_NCPUS];
-#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
- struct note_filter_mode_s mode;
+static void sysview_start(FAR struct note_driver_s *drv,
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]