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:
yinshengkai
2024-01-26 15:50:18 +08:00
committed by Xiang Xiao
parent 6b07284c61
commit e28b311b78
11 changed files with 104 additions and 50 deletions
+4 -4
View File
@@ -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
-4
View File
@@ -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 \