This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit accc862075e7fac1e5e38e78a5d8bd99cae7bdbb Author: wangzhi16 <[email protected]> AuthorDate: Mon Mar 16 20:41:49 2026 +0800 sched/irq: rename csection monitoring symbols to irqdis Rename all csection-specific monitoring symbols to irqdis to better reflect that the monitoring now covers all IRQ-disabled paths, not just enter_critical_section. Symbol renames: - SCHED_CRITMONITOR_MAXTIME_CSECTION -> MAXTIME_IRQDISABLE (Kconfig) - nxsched_critmon_csection() -> nxsched_critmon_irqdisable() - CHECK_CSECTION -> CHECK_IRQDIS - TCB fields: crit_start/max/count/caller/max_caller -> irqdis_start/max/count/caller/max_caller - g_crit_max -> g_irqdis_max Update comments and Kconfig help text to replace 'critical section' with 'IRQ disabled' where the statement now covers all irq_save / irq_restore call sites. Assisted-By: mimo-v2.6-pro Co-authored-by: ouyangxiangzhen <[email protected]> Signed-off-by: wangzhi16 <[email protected]> Signed-off-by: ouyangxiangzhen <[email protected]> --- fs/procfs/fs_procfscritmon.c | 8 ++-- fs/procfs/fs_procfsproc.c | 12 +++--- include/nuttx/irq.h | 20 +++++----- include/nuttx/sched.h | 20 +++++----- include/nuttx/spinlock.h | 8 ++-- sched/Kconfig | 13 +++---- sched/irq/irq_csection.c | 4 +- sched/sched/sched.h | 2 +- sched/sched/sched_critmonitor.c | 82 ++++++++++++++++++++--------------------- sched/task/task_restart.c | 12 +++--- 10 files changed, 90 insertions(+), 91 deletions(-) diff --git a/fs/procfs/fs_procfscritmon.c b/fs/procfs/fs_procfscritmon.c index 9fb12a374fc..04078b1106b 100644 --- a/fs/procfs/fs_procfscritmon.c +++ b/fs/procfs/fs_procfscritmon.c @@ -250,12 +250,12 @@ static ssize_t critmon_read_cpu(FAR struct critmon_file_s *attr, } #endif -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 /* Convert and generate output for maximum time in a critical section */ - if (g_crit_max[cpu] > 0) + if (g_irqdis_max[cpu] > 0) { - perf_convert(g_crit_max[cpu], &maxtime); + perf_convert(g_irqdis_max[cpu], &maxtime); } else { @@ -265,7 +265,7 @@ static ssize_t critmon_read_cpu(FAR struct critmon_file_s *attr, /* Reset the maximum */ - g_crit_max[cpu] = 0; + g_irqdis_max[cpu] = 0; /* Generate output for maximum time in a critical section */ diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index 1d137870829..b3d84d0359d 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -852,10 +852,10 @@ static ssize_t proc_critmon(FAR struct proc_file_s *procfile, /* Convert and generate output for maximum time in a critical section */ -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 - if (tcb->crit_max > 0) +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 + if (tcb->irqdis_max > 0) { - perf_convert(tcb->crit_max, &maxtime); + perf_convert(tcb->irqdis_max, &maxtime); } else { @@ -865,14 +865,14 @@ static ssize_t proc_critmon(FAR struct proc_file_s *procfile, /* Reset the maximum */ - tcb->crit_max = 0; + tcb->irqdis_max = 0; /* Generate output for maximum time in a critical section */ linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%jd.%09ld %p,", (intmax_t)maxtime.tv_sec, maxtime.tv_nsec, - tcb->crit_max_caller); + tcb->irqdis_max_caller); copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset); @@ -884,7 +884,7 @@ static ssize_t proc_critmon(FAR struct proc_file_s *procfile, { return totalsize; } -#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 */ +#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 */ /* Convert and generate output for max busywait time && all busywait time */ diff --git a/include/nuttx/irq.h b/include/nuttx/irq.h index 09cfeb6f32e..98f468668f4 100644 --- a/include/nuttx/irq.h +++ b/include/nuttx/irq.h @@ -152,8 +152,8 @@ # define CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION -1 #endif -#ifndef CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION -# define CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION -1 +#ifndef CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE +# define CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE -1 #endif #ifndef CONFIG_SCHED_CRITMONITOR_MAXTIME_BUSYWAIT @@ -244,28 +244,28 @@ int ndx_to_irq(int ndx); * * Description: * Wrapper around up_irq_save/up_irq_restore with IRQ disabled duration - * monitoring via nxsched_critmon_csection. + * monitoring via nxsched_critmon_irqdisable. * ****************************************************************************/ #ifndef __ASSEMBLY__ -# if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 -void nxsched_critmon_csection(bool state, bool force, FAR void *caller); +# if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 +void nxsched_critmon_irqdisable(bool state, bool force, FAR void *caller); static inline_function irqstate_t irq_save(void) { irqstate_t flags = up_irq_save(); - nxsched_critmon_csection(true, false, return_address(0)); + nxsched_critmon_irqdisable(true, false, return_address(0)); return flags; } static inline_function void irq_restore(irqstate_t flags) { - nxsched_critmon_csection(false, false, return_address(0)); + nxsched_critmon_irqdisable(false, false, return_address(0)); up_irq_restore(flags); } # else -# define nxsched_critmon_csection(state, force, caller) +# define nxsched_critmon_irqdisable(state, force, caller) # define irq_save() up_irq_save() # define irq_restore(flags) up_irq_restore(flags) # endif @@ -369,7 +369,7 @@ int irqchain_detach(int irq, xcpt_t isr, FAR void *arg); ****************************************************************************/ #ifdef CONFIG_IRQCOUNT -# if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 || \ +# if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 || \ CONFIG_SCHED_CRITMONITOR_MAXTIME_BUSYWAIT >= 0 || \ defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) irqstate_t enter_critical_section(void) noinstrument_function; @@ -408,7 +408,7 @@ irqstate_t enter_critical_section_notrace(void) noinstrument_function; ****************************************************************************/ #ifdef CONFIG_IRQCOUNT -# if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 || \ +# if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 || \ defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) void leave_critical_section(irqstate_t flags) noinstrument_function; # else diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index 7c2fd7c540f..de083f93413 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -786,12 +786,12 @@ struct tcb_s void *preemp_max_caller; /* Caller of max preemption */ #endif -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 - clock_t crit_start; /* Time critical section entered */ - clock_t crit_max; /* Max time in critical section */ - int crit_count; /* Nest count of critical section */ - void *crit_caller; /* Caller of critical section */ - void *crit_max_caller; /* Caller of max critical section */ +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 + clock_t irqdis_start; /* Time IRQ disabled */ + clock_t irqdis_max; /* Max time IRQ disabled */ + int irqdis_count; /* Nest count of IRQ disabled */ + void *irqdis_caller; /* Caller of IRQ disable */ + void *irqdis_max_caller; /* Caller of max IRQ disable time */ #endif #if CONFIG_SCHED_CRITMONITOR_MAXTIME_BUSYWAIT >= 0 @@ -906,15 +906,15 @@ extern "C" { #endif -/* Maximum time with pre-emption disabled or within critical section. */ +/* Maximum time with pre-emption disabled or with IRQs disabled. */ #if CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 extern clock_t g_preemp_max[CONFIG_SMP_NCPUS]; #endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 */ -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 -extern clock_t g_crit_max[CONFIG_SMP_NCPUS]; -#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 */ +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 +extern clock_t g_irqdis_max[CONFIG_SMP_NCPUS]; +#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 */ #if CONFIG_SCHED_CRITMONITOR_MAXTIME_BUSYWAIT >= 0 extern clock_t g_busywait_max[CONFIG_SMP_NCPUS]; diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h index 7471a8a91d3..87bb380f488 100644 --- a/include/nuttx/spinlock.h +++ b/include/nuttx/spinlock.h @@ -1121,11 +1121,11 @@ void rspin_unlock_irqrestore(FAR rspinlock_t *lock, irqstate_t flags) else { /* Not last unlock, irq_restore is not called, but we need to - * balance the crit_count that was incremented by irq_save() + * balance the irqdis_count that was incremented by irq_save() * in the corresponding rspin_lock_irqsave(). */ - nxsched_critmon_csection(false, false, return_address(0)); + nxsched_critmon_irqdisable(false, false, return_address(0)); } } #else @@ -1156,7 +1156,7 @@ uint16_t rspin_breaklock(FAR rspinlock_t *lock) * enabled interrupt. */ - nxsched_critmon_csection(false, true, return_address(0)); + nxsched_critmon_irqdisable(false, true, return_address(0)); oldcount = RSPINLOCK_COUNT(val); lock->local_val = RSPINLOCK_VALUE(owner, 1u); @@ -1180,7 +1180,7 @@ void rspin_restorelock(FAR rspinlock_t *lock, uint16_t count) * disabled interrupt. */ - nxsched_critmon_csection(true, true, return_address(0)); + nxsched_critmon_irqdisable(true, true, return_address(0)); } } #else diff --git a/sched/Kconfig b/sched/Kconfig index d9ff0175c89..94782ac8720 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -1136,29 +1136,28 @@ config SCHED_CRITMONITOR_MAXTIME_PREEMPTION SCHED_CRITMONITOR_MAXTIME_PREEMPTION, or system will give a warning. For debugging system latency, 0 means disabled. -config SCHED_CRITMONITOR_MAXTIME_CSECTION +config SCHED_CRITMONITOR_MAXTIME_IRQDISABLE int "IRQ disabled (irq_save/irq_restore) max holding time" default SCHED_CRITMONITOR_MAXTIME_PREEMPTION ---help--- IRQ disabled time (via irq_save/irq_restore, covering enter_critical_section, spin_lock_irqsave, rspin_lock_irqsave, etc.) should be smaller than - SCHED_CRITMONITOR_MAXTIME_CSECTION, or system will give a warning. + SCHED_CRITMONITOR_MAXTIME_IRQDISABLE, or system will give a warning. For debugging system latency, 0 means disabled. config SCHED_CRITMONITOR_MAXTIME_BUSYWAIT - int "Critical section or spinlock max busy waiting time" + int "Spinlock max busy waiting time" default -1 ---help--- - Busy waiting time to enter critical section or - get spinlock should be smaller than + Busy waiting time to acquire a spinlock should be smaller than SCHED_CRITMONITOR_MAXTIME_BUSYWAIT, or system will give a warning. For debugging system latency, 0 means disabled, -1 means not configured (feature off, no statistics collected). config SCHED_CRITMONITOR_MAXTIME_IRQ int "IRQ max execution time" - default SCHED_CRITMONITOR_MAXTIME_CSECTION + default SCHED_CRITMONITOR_MAXTIME_IRQDISABLE ---help--- IRQ handler execution time should be smaller than SCHED_CRITMONITOR_MAXTIME_IRQ, or system will give a warning. @@ -1181,7 +1180,7 @@ config SCHED_CRITMONITOR_MAXTIME_PANIC SCHED_CRITMONITOR_MAXTIME_WDOG > 0 || \ SCHED_CRITMONITOR_MAXTIME_WQUEUE > 0 || \ SCHED_CRITMONITOR_MAXTIME_PREEMPTION > 0 || \ - SCHED_CRITMONITOR_MAXTIME_CSECTION > 0 || \ + SCHED_CRITMONITOR_MAXTIME_IRQDISABLE > 0 || \ SCHED_CRITMONITOR_MAXTIME_BUSYWAIT > 0 || \ SCHED_CRITMONITOR_MAXTIME_IRQ > 0 default n diff --git a/sched/irq/irq_csection.c b/sched/irq/irq_csection.c index 656b411eb5a..607069bf2e0 100644 --- a/sched/irq/irq_csection.c +++ b/sched/irq/irq_csection.c @@ -285,7 +285,7 @@ irqstate_t enter_critical_section_notrace(void) } #endif -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 || \ +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 || \ CONFIG_SCHED_CRITMONITOR_MAXTIME_BUSYWAIT >= 0 || \ defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) irqstate_t enter_critical_section(void) @@ -457,7 +457,7 @@ void leave_critical_section_notrace(irqstate_t flags) } #endif -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 || \ +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 || \ defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) void leave_critical_section(irqstate_t flags) { diff --git a/sched/sched/sched.h b/sched/sched/sched.h index fcc67cb6dbf..4b7d4a0a9a1 100644 --- a/sched/sched/sched.h +++ b/sched/sched/sched.h @@ -421,7 +421,7 @@ static inline_function FAR struct tcb_s *this_task(void) irqstate_t flags; /* Use up_irq_save directly to avoid recursion when called from - * irq_save() -> nxsched_critmon_csection() -> running_task() path. + * irq_save() -> nxsched_critmon_irqdisable() -> running_task() path. */ flags = up_irq_save(); diff --git a/sched/sched/sched_critmonitor.c b/sched/sched/sched_critmonitor.c index 32403ae0b88..4d46e0c71ec 100644 --- a/sched/sched/sched_critmonitor.c +++ b/sched/sched/sched_critmonitor.c @@ -56,12 +56,12 @@ # define CHECK_PREEMPTION(pid, elapsed) #endif -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION > 0 -# define CHECK_CSECTION(pid, elapsed) \ +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE > 0 +# define CHECK_IRQDIS(pid, elapsed) \ do \ { \ if (pid > 0 && \ - elapsed > CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION) \ + elapsed > CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE) \ { \ CRITMONITOR_PANIC("PID %d disable interrupt too long " \ "%ju\n", pid, (uintmax_t)elapsed); \ @@ -69,7 +69,7 @@ } \ while (0) #else -# define CHECK_CSECTION(pid, elapsed) +# define CHECK_IRQDIS(pid, elapsed) #endif #if CONFIG_SCHED_CRITMONITOR_MAXTIME_BUSYWAIT > 0 @@ -132,14 +132,14 @@ static clock_t g_thread_start[CONFIG_SMP_NCPUS]; * Public Data ****************************************************************************/ -/* Maximum time with pre-emption disabled or within critical section. */ +/* Maximum time with pre-emption disabled or with IRQs disabled. */ #if CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 clock_t g_preemp_max[CONFIG_SMP_NCPUS]; #endif -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 -clock_t g_crit_max[CONFIG_SMP_NCPUS]; +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 +clock_t g_irqdis_max[CONFIG_SMP_NCPUS]; #endif #if CONFIG_SCHED_CRITMONITOR_MAXTIME_BUSYWAIT >= 0 @@ -197,7 +197,7 @@ static clock_t nxsched_critmon_account(FAR struct tcb_s *tcb, int cpu, * Called when there is any change in pre-emptible state of a thread. * * Assumptions: - * - Called within a critical section. + * - Called with IRQs disabled. * - Never called from an interrupt handler * - Caller is the address of the function that is changing the pre-emption * @@ -248,7 +248,7 @@ void nxsched_critmon_preemption(FAR struct tcb_s *tcb, bool state, #endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 */ /**************************************************************************** - * Name: nxsched_critmon_csection + * Name: nxsched_critmon_irqdisable * * Description: * Called by irq_save/irq_restore wrappers when a thread disables or @@ -262,8 +262,8 @@ void nxsched_critmon_preemption(FAR struct tcb_s *tcb, bool state, * ****************************************************************************/ -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 -void nxsched_critmon_csection(bool state, bool force, FAR void *caller) +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 +void nxsched_critmon_irqdisable(bool state, bool force, FAR void *caller) { FAR struct tcb_s *tcb = running_task(); clock_t current; @@ -272,13 +272,13 @@ void nxsched_critmon_csection(bool state, bool force, FAR void *caller) * is recorded in nxtask_exit(). */ - if (tcb == NULL || (!force && state && tcb->crit_count++ != 0) || - (!force && !state && --tcb->crit_count != 0)) + if (tcb == NULL || (!force && state && tcb->irqdis_count++ != 0) || + (!force && !state && --tcb->irqdis_count != 0)) { return; } - /* Call perf_gettime only tcb->crit_count == 0 or 1, prevent recursion. */ + /* Call perf_gettime only tcb->irqdis_count == 0 or 1, prevent recursion. */ current = perf_gettime(); @@ -288,42 +288,42 @@ void nxsched_critmon_csection(bool state, bool force, FAR void *caller) { /* Disabling... Save the start time. */ - tcb->crit_start = current; - tcb->crit_caller = caller; + tcb->irqdis_start = current; + tcb->irqdis_caller = caller; } else { /* Enabling.. Check for the max elapsed time */ - clock_t elapsed = current - tcb->crit_start; + clock_t elapsed = current - tcb->irqdis_start; int cpu = this_cpu(); - if (elapsed > tcb->crit_max) + if (elapsed > tcb->irqdis_max) { - tcb->crit_max = elapsed; - tcb->crit_max_caller = tcb->crit_caller; - CHECK_CSECTION(tcb->pid, elapsed); + tcb->irqdis_max = elapsed; + tcb->irqdis_max_caller = tcb->irqdis_caller; + CHECK_IRQDIS(tcb->pid, elapsed); } /* Check for the global max elapsed time */ - if (elapsed > g_crit_max[cpu]) + if (elapsed > g_irqdis_max[cpu]) { - g_crit_max[cpu] = elapsed; + g_irqdis_max[cpu] = elapsed; } } } -#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 */ +#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 */ /**************************************************************************** * Name: nxsched_critmon_busywait * * Description: - * Called when a thread try to enter critical section(get spinlock) or - * successfully entered cirtical section. + * Called when a thread tries to acquire a spinlock (busy-waiting) or + * has successfully acquired it. * * Assumptions: - * - Called before a critical section or within a critical section. + * - Called before acquiring or immediately after acquiring a spinlock. * - Might be called from an interrupt handler. * ****************************************************************************/ @@ -334,7 +334,7 @@ void nxsched_critmon_busywait(bool state, FAR void *caller) FAR struct tcb_s *tcb = this_task(); clock_t current = perf_gettime(); - /* Are we busy waiting for critical section or spinlock? */ + /* Are we busy waiting for a spinlock? */ if (state) { @@ -345,7 +345,7 @@ void nxsched_critmon_busywait(bool state, FAR void *caller) } else { - /* Entered critical section... Check for the max elapsed time */ + /* Acquired spinlock... Check for the max elapsed time */ clock_t elapsed = current - tcb->busywait_start; int cpu = this_cpu(); @@ -462,7 +462,7 @@ void nxsched_suspend_critmon(FAR struct tcb_s *tcb) #endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION */ -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 /* Is this task in a critical section? */ @@ -472,23 +472,23 @@ void nxsched_suspend_critmon(FAR struct tcb_s *tcb) /* Possibly leaving .. Check for the max elapsed time */ - elapsed = current - tcb->crit_start; - if (elapsed > tcb->crit_max) + elapsed = current - tcb->irqdis_start; + if (elapsed > tcb->irqdis_max) { - tcb->crit_max = elapsed; - tcb->crit_max_caller = tcb->crit_caller; - CHECK_CSECTION(tcb->pid, elapsed); + tcb->irqdis_max = elapsed; + tcb->irqdis_max_caller = tcb->irqdis_caller; + CHECK_IRQDIS(tcb->pid, elapsed); } /* Check for the global max elapsed time */ - if (elapsed > g_crit_max[cpu]) + if (elapsed > g_irqdis_max[cpu]) { - g_crit_max[cpu] = elapsed; + g_irqdis_max[cpu] = elapsed; } } -#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION */ +#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE */ } /**************************************************************************** @@ -535,12 +535,12 @@ void nxsched_resume_critmon(FAR struct tcb_s *tcb) } #endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION */ -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 if (tcb->irqcount > 0) { - tcb->crit_start = current; + tcb->irqdis_start = current; } -#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION */ +#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE */ } /**************************************************************************** diff --git a/sched/task/task_restart.c b/sched/task/task_restart.c index 6ee71e78358..d39b4b79f37 100644 --- a/sched/task/task_restart.c +++ b/sched/task/task_restart.c @@ -281,12 +281,12 @@ static int nxtask_restart(pid_t pid) tcb->preemp_max_caller = NULL; #endif -#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 - tcb->crit_start = 0; - tcb->crit_max = 0; - tcb->crit_count = 0; - tcb->crit_caller = NULL; - tcb->crit_max_caller = NULL; +#if CONFIG_SCHED_CRITMONITOR_MAXTIME_IRQDISABLE >= 0 + tcb->irqdis_start = 0; + tcb->irqdis_max = 0; + tcb->irqdis_count = 0; + tcb->irqdis_caller = NULL; + tcb->irqdis_max_caller = NULL; #endif #if CONFIG_SCHED_CRITMONITOR_MAXTIME_BUSYWAIT >= 0
