xiaoxiang781216 commented on code in PR #7841: URL: https://github.com/apache/nuttx/pull/7841#discussion_r1045221062
########## include/nuttx/sched_note.h: ########## @@ -435,6 +435,56 @@ struct note_filter_irq_s #endif /* CONFIG_SCHED_INSTRUMENTATION_FILTER */ +struct sched_note_ops_s +{ + void (*start)(FAR void *priv, FAR struct tcb_s *tcb); + void (*stop)(FAR void *priv, FAR struct tcb_s *tcb); +#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH + void (*suspend)(FAR void *priv, FAR struct tcb_s *tcb); + void (*resume)(FAR void *priv, FAR struct tcb_s *tcb); +#ifdef CONFIG_SMP + void (*cpu_start)(FAR void *priv, FAR struct tcb_s *tcb, int cpu); + void (*cpu_started)(FAR void *priv, FAR struct tcb_s *tcb); + void (*cpu_pause)(FAR void *priv, FAR struct tcb_s *tcb, int cpu); + void (*cpu_paused)(FAR void *priv, FAR struct tcb_s *tcb); + void (*cpu_resume)(FAR void *priv, FAR struct tcb_s *tcb, int cpu); + void (*cpu_resumed)(FAR void *priv, FAR struct tcb_s *tcb); +#endif +#endif +#ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION + void (*premption)(FAR void *priv, FAR struct tcb_s *tcb, bool locked); +#endif +#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION + void (*csection)(FAR void *priv, FAR struct tcb_s *tcb, bool enter); +#endif +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + void (*spinlock)(FAR void *priv, FAR struct tcb_s *tcb, + FAR volatile void *spinlock, int type); +#endif +#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL + void (*syscall_enter)(FAR void *priv, int nr); + void (*syscall_leave)(FAR void *priv, int nr); +#endif +#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER + void (*irqhandler)(FAR void *priv, int irq, FAR void *handler, bool enter); +#endif +#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP + void (*write)(FAR void *priv, FAR const void *note, size_t notelen); +#endif +}; + +struct note_channels_s Review Comment: let's follow syslog_channel_s style: ``` struct note_driver_s { FAR const struct note_driver_ops_s *ops; /* Implementation specific logic may follow */ }; ``` -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org