Move scheduler instrumentation hooks out of sched.h (where they seem like application interfaces) and into nuttx/sched.h where it is clare that these are OS internal interfaces.

This commit is contained in:
Gregory Nutt 2016-03-16 11:00:31 -06:00
parent 5675600946
commit e879d0f423
6 changed files with 49 additions and 43 deletions

2
arch

@ -1 +1 @@
Subproject commit 57328005643fab97828d3deb4a1cd3db70d89b02
Subproject commit ff28c33a233e86ab8d96434dcd87ccd5402e505b

@ -1 +1 @@
Subproject commit 0ef97e910a44060bd20b5e96517344a324e965c3
Subproject commit e147b03efbd424a972e1dd61707c6182b90174f7

View File

@ -82,4 +82,3 @@ config SYSLOG_CONSOLE
output (syslog_putc). This is useful, for example, if the only console is a Telnet
console. Then in that case, console output from non-Telnet threads will go to
the syslog output.

View File

@ -64,11 +64,6 @@ namespace std
using ::sched_lock;
using ::sched_unlock;
using ::sched_lockcount;
#ifdef CONFIG_SCHED_INSTRUMENTATION
using ::sched_note_start;
using ::sched_note_stop;
using ::sched_note_switch;
#endif
}
#endif // __INCLUDE_CXX_CSCHED

View File

@ -843,6 +843,49 @@ void sched_suspend_scheduler(FAR struct tcb_s *tcb);
# define sched_suspend_scheduler(tcb)
#endif
/********************************************************************************
* Name: sched_note_*
*
* Description:
* If instrumentation of the scheduler is enabled, then some outboard logic
* must provide the following interfaces. These interfaces are not availalble
* to application code.
*
* Input Parameters:
* tcb - The TCB of the thread to be restarted.
*
* Returned Value:
* None
*
********************************************************************************/
#ifdef CONFIG_SCHED_INSTRUMENTATION
void sched_note_start(FAR struct tcb_s *tcb);
void sched_note_stop(FAR struct tcb_s *tcb);
void sched_note_switch(FAR struct tcb_s *fromtcb,
FAR struct tcb_s *totcb);
#ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION
void sched_note_premption(FAR struct tcb_s *tcb, bool locked);
#else
# define sched_note_premption(t,l)
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
void sched_note_csection(FAR struct tcb_s *tcb, bool enter);
#else
# define sched_note_csection(t,e)
#endif
#else
# define sched_note_start(t)
# define sched_note_stop(t)
# define sched_note_switch(t1, t2)
# define sched_note_premption(t,l)
# define sched_note_csection(t,e)
#endif /* CONFIG_SCHED_INSTRUMENTATION */
#undef EXTERN
#if defined(__cplusplus)
}

View File

@ -243,10 +243,10 @@ int sched_rr_get_interval(pid_t pid, FAR struct timespec *interval);
#ifdef CONFIG_SMP
/* Task affinity */
int sched_setaffinity(pid_t pid, size_t cpusetsize,
FAR const cpu_set_t *mask);
int sched_getaffinity(pid_t pid, size_t cpusetsize, FAR cpu_set_t *mask);
int sched_cpu_count(FAR const cpu_set_t *set);
int sched_setaffinity(pid_t pid, size_t cpusetsize,
FAR const cpu_set_t *mask);
int sched_getaffinity(pid_t pid, size_t cpusetsize, FAR cpu_set_t *mask);
int sched_cpu_count(FAR const cpu_set_t *set);
#endif /* CONFIG_SMP */
/* Task Switching Interfaces (non-standard) */
@ -255,37 +255,6 @@ int sched_lock(void);
int sched_unlock(void);
int sched_lockcount(void);
/* If instrumentation of the scheduler is enabled, then some outboard logic
* must provide the following interfaces.
*/
#ifdef CONFIG_SCHED_INSTRUMENTATION
void sched_note_start(FAR struct tcb_s *tcb);
void sched_note_stop(FAR struct tcb_s *tcb);
void sched_note_switch(FAR struct tcb_s *fromtcb,
FAR struct tcb_s *totcb);
#ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION
void sched_note_premption(FAR struct tcb_s *tcb, bool locked);
#else
# define sched_note_premption(t,l)
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
void sched_note_csection(FAR struct tcb_s *tcb, bool enter);
#else
# define sched_note_csection(t,e)
#endif
#else
# define sched_note_start(t)
# define sched_note_stop(t)
# define sched_note_switch(t1, t2)
# define sched_note_premption(t,l)
# define sched_note_csection(t,e)
#endif /* CONFIG_SCHED_INSTRUMENTATION */
#undef EXTERN
#if defined(__cplusplus)
}