xiaoxiang781216 commented on a change in pull request #1377:
URL: https://github.com/apache/incubator-nuttx/pull/1377#discussion_r498810165
##########
File path: sched/Kconfig
##########
@@ -1000,6 +1000,26 @@ config SCHED_INSTRUMENTATION_FILTER
The filter logic can be configured by sched_note_filter APIs
defined in
include/nuttx/sched_note.h.
+config SCHED_INSTRUMENTATION_FILTER_ENABLE_ONBOOT
Review comment:
How about we change enable field to a flag part of flag field? so we can
control the initial state by one Kconfig option.
##########
File path: drivers/note/noteram_driver.c
##########
@@ -435,6 +586,17 @@ void sched_note_add(FAR const void *note, size_t notelen)
next = noteram_next(head, 1);
if (next == g_noteram_info.ni_tail)
{
+ if (!g_noteram_info.ni_overwrite)
+ {
+ /* Stop recording if not in overwrite mode */
+
+#ifdef CONFIG_SMP
+ spin_unlock_wo_note(&g_noteram_lock);
+ up_irq_restore(flags);
+#endif
+ return;
Review comment:
> In this case ni_head should not be updated. Because an incomplete note
struct is recorded in the circular buffer if updated. If not updated, the
incompletely recorded note will be simply discarded.
>
Ok.
> But, I found another problem in this case.
> If the buffer have 16bytes free space, and 20bytes note and 12bytes note
arrives sequentially, the former incoming note is discarded but only the latter
note is recorded. This is an unexpected behavior.
> I think that we need to add the flag to control whether we record the
incoming note or not.
> When in not overwrite mode, once we found an incoming note which is
greater than the free space, disable the flag to block the following notes.
maybe we can change ni_overwrite to tristate(disable, enable, overflow).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]