mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
Make each function of SCHED_CRITMONITOR independent
There will be a large performance loss after SCHED_CRITMONITOR is enabled. By isolating thread running time-related functions, CPU load can be run with less overhead. Signed-off-by: yinshengkai <yinshengkai@xiaomi.com> Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
@@ -382,7 +382,7 @@ try_again_in_irq:
|
||||
|
||||
/* Note that we have entered the critical section */
|
||||
|
||||
#ifdef CONFIG_SCHED_CRITMONITOR
|
||||
#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0
|
||||
nxsched_critmon_csection(rtcb, true);
|
||||
#endif
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
|
||||
@@ -422,7 +422,7 @@ irqstate_t enter_critical_section(void)
|
||||
{
|
||||
/* Note that we have entered the critical section */
|
||||
|
||||
#ifdef CONFIG_SCHED_CRITMONITOR
|
||||
#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0
|
||||
nxsched_critmon_csection(rtcb, true);
|
||||
#endif
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
|
||||
@@ -523,7 +523,7 @@ void leave_critical_section(irqstate_t flags)
|
||||
{
|
||||
/* No.. Note that we have left the critical section */
|
||||
|
||||
#ifdef CONFIG_SCHED_CRITMONITOR
|
||||
#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0
|
||||
nxsched_critmon_csection(rtcb, false);
|
||||
#endif
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
|
||||
@@ -577,7 +577,7 @@ void leave_critical_section(irqstate_t flags)
|
||||
{
|
||||
/* Note that we have left the critical section */
|
||||
|
||||
#ifdef CONFIG_SCHED_CRITMONITOR
|
||||
#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0
|
||||
nxsched_critmon_csection(rtcb, false);
|
||||
#endif
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
|
||||
|
||||
@@ -51,10 +51,6 @@
|
||||
* interrupt request
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQ
|
||||
# define CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQ 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SCHED_IRQMONITOR
|
||||
# define CALL_VECTOR(ndx, vector, irq, context, arg) \
|
||||
do \
|
||||
|
||||
Reference in New Issue
Block a user