pkarashchenko commented on code in PR #7809: URL: https://github.com/apache/nuttx/pull/7809#discussion_r1043101284
########## drivers/segger/note_sysview.h: ########## @@ -0,0 +1,65 @@ +/**************************************************************************** + * drivers/segger/note_sysview.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __DRIVERS_SEGGER_SYSVIEW_H +#define __DRIVERS_SEGGER_SYSVIEW_H + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +void sysview_note_start(FAR struct tcb_s *tcb); + +void sysview_note_stop(FAR struct tcb_s *tcb); + +void sysview_note_suspend(FAR struct tcb_s *tcb); + +void sysview_note_resume(FAR struct tcb_s *tcb); + +#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER +void sysview_note_irqhandler(int irq, FAR void *handler, bool enter); +#endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL +void sysview_note_syscall_enter(int nr); +void sysview_note_syscall_leave(int nr, uintptr_t result); +#endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER +void sysview_note_filter_mode(struct note_filter_mode_s *oldm, + struct note_filter_mode_s *newm); +#endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER +void sysview_note_filter_irq(struct note_filter_irq_s *oldf, + struct note_filter_irq_s *newf); +#endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER +void sysview_note_filter_irq(struct note_filter_irq_s *oldf, + struct note_filter_irq_s *newf); +#endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL +void sysview_note_filter_syscall(struct note_filter_syscall_s *oldf, Review Comment: some places have FAR and some not ########## drivers/segger/note_sysview.c: ########## @@ -275,7 +276,12 @@ static inline int sysview_isenabled_syscall(int nr) * ****************************************************************************/ -void sched_note_start(FAR struct tcb_s *tcb) +void weak_function sched_note_start(FAR struct tcb_s *tcb) +{ + sysview_note_start(tcb); +} + +void inline sysview_note_start(FAR struct tcb_s *tcb) Review Comment: will inline have any effect in such usage? I mean that `sysview_note_start` declared after `sched_note_start`. Also, why do we need `sysview_note_start` at all? ########## drivers/segger/note_sysview.c: ########## @@ -624,7 +716,36 @@ void sched_note_filter_irq(struct note_filter_irq_s *oldf, ****************************************************************************/ #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL -void sched_note_filter_syscall(struct note_filter_syscall_s *oldf, +void weak_function sched_note_filter_syscall( + struct note_filter_syscall_s *oldf, + struct note_filter_syscall_s *newf) +{ + sysview_note_filter_syscall(oldf, newf); +} +#endif + +/**************************************************************************** + * Name: sysview_note_filter_syscall + * + * Description: + * Set and get syscall filter setting + * (Same as NOTECTL_GETSYSCALLFILTER / NOTECTL_SETSYSCALLFILTER ioctls) + * + * Input Parameters: + * oldf - A writable pointer to struct note_filter_syscall_s to get + * current syscall filter setting + * If 0, no data is written. + * newf - A read-only pointer to struct note_filter_syscall_s of the + * new syscall filter setting + * If 0, the setting is not updated. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL +void inline sysview_note_filter_syscall(struct note_filter_syscall_s *oldf, struct note_filter_syscall_s *newf) Review Comment: ```suggestion void inline sysview_note_filter_syscall(struct note_filter_syscall_s *oldf, struct note_filter_syscall_s *newf) ``` -- 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