From 24add5eeaffaf8834d4ab306bc647cf54a0efedb Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 25 Nov 2024 17:23:43 +0800 Subject: [PATCH] spelling: fix spelling typo premp -> preemp Signed-off-by: chao an --- fs/procfs/fs_procfscritmon.c | 6 +++--- fs/procfs/fs_procfsproc.c | 8 ++++---- include/nuttx/sched.h | 10 +++++----- sched/sched/sched_critmonitor.c | 32 ++++++++++++++++---------------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/fs/procfs/fs_procfscritmon.c b/fs/procfs/fs_procfscritmon.c index 90444425b9..96c2e88a3b 100644 --- a/fs/procfs/fs_procfscritmon.c +++ b/fs/procfs/fs_procfscritmon.c @@ -214,9 +214,9 @@ static ssize_t critmon_read_cpu(FAR struct critmon_file_s *attr, #if CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 /* Convert the for maximum time pre-emption disabled */ - if (g_premp_max[cpu] > 0) + if (g_preemp_max[cpu] > 0) { - perf_convert(g_premp_max[cpu], &maxtime); + perf_convert(g_preemp_max[cpu], &maxtime); } else { @@ -226,7 +226,7 @@ static ssize_t critmon_read_cpu(FAR struct critmon_file_s *attr, /* Reset the maximum */ - g_premp_max[cpu] = 0; + g_preemp_max[cpu] = 0; /* Generate output for maximum time pre-emption disabled */ diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index 47ddab09cf..f682e9784d 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -774,9 +774,9 @@ static ssize_t proc_critmon(FAR struct proc_file_s *procfile, /* Convert the for maximum time pre-emption disabled */ #if CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 - if (tcb->premp_max > 0) + if (tcb->preemp_max > 0) { - perf_convert(tcb->premp_max, &maxtime); + perf_convert(tcb->preemp_max, &maxtime); } else { @@ -786,14 +786,14 @@ static ssize_t proc_critmon(FAR struct proc_file_s *procfile, /* Reset the maximum */ - tcb->premp_max = 0; + tcb->preemp_max = 0; /* Generate output for maximum time pre-emption disabled */ linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%lu.%09lu %p,", (unsigned long)maxtime.tv_sec, (unsigned long)maxtime.tv_nsec, - tcb->premp_max_caller); + tcb->preemp_max_caller); copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset); diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index 1b2c4279b4..7f57396f37 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -702,10 +702,10 @@ struct tcb_s #endif #if CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 - clock_t premp_start; /* Time when preemption disabled */ - clock_t premp_max; /* Max time preemption disabled */ - void *premp_caller; /* Caller of preemption disabled */ - void *premp_max_caller; /* Caller of max preemption */ + clock_t preemp_start; /* Time when preemption disabled */ + clock_t preemp_max; /* Max time preemption disabled */ + void *preemp_caller; /* Caller of preemption disabled */ + void *preemp_max_caller; /* Caller of max preemption */ #endif #if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 @@ -867,7 +867,7 @@ extern "C" /* Maximum time with pre-emption disabled or within critical section. */ #if CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 -EXTERN clock_t g_premp_max[CONFIG_SMP_NCPUS]; +EXTERN clock_t g_preemp_max[CONFIG_SMP_NCPUS]; #endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 */ #if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 diff --git a/sched/sched/sched_critmonitor.c b/sched/sched/sched_critmonitor.c index 37180a22f3..bf547b52cf 100644 --- a/sched/sched/sched_critmonitor.c +++ b/sched/sched/sched_critmonitor.c @@ -93,7 +93,7 @@ /* Maximum time with pre-emption disabled or within critical section. */ #if CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION >= 0 -clock_t g_premp_max[CONFIG_SMP_NCPUS]; +clock_t g_preemp_max[CONFIG_SMP_NCPUS]; #endif #if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 @@ -182,28 +182,28 @@ void nxsched_critmon_preemption(FAR struct tcb_s *tcb, bool state, { /* Disabling.. Save the thread start time */ - tcb->premp_start = current; - tcb->premp_caller = caller; + tcb->preemp_start = current; + tcb->preemp_caller = caller; } else { /* Re-enabling.. Check for the max elapsed time */ - clock_t elapsed = current - tcb->premp_start; + clock_t elapsed = current - tcb->preemp_start; int cpu = this_cpu(); - if (elapsed > tcb->premp_max) + if (elapsed > tcb->preemp_max) { - tcb->premp_max = elapsed; - tcb->premp_max_caller = tcb->premp_caller; + tcb->preemp_max = elapsed; + tcb->preemp_max_caller = tcb->preemp_caller; CHECK_PREEMPTION(tcb->pid, elapsed); } /* Check for the global max elapsed time */ - if (elapsed > g_premp_max[cpu]) + if (elapsed > g_preemp_max[cpu]) { - g_premp_max[cpu] = elapsed; + g_preemp_max[cpu] = elapsed; } } } @@ -291,7 +291,7 @@ void nxsched_resume_critmon(FAR struct tcb_s *tcb) { /* Yes.. Save the start time */ - tcb->premp_start = current; + tcb->preemp_start = current; } #endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION */ @@ -349,11 +349,11 @@ void nxsched_suspend_critmon(FAR struct tcb_s *tcb) { /* Possibly re-enabling.. Check for the max elapsed time */ - elapsed = current - tcb->premp_start; - if (elapsed > tcb->premp_max) + elapsed = current - tcb->preemp_start; + if (elapsed > tcb->preemp_max) { - tcb->premp_max = elapsed; - tcb->premp_max_caller = tcb->premp_caller; + tcb->preemp_max = elapsed; + tcb->preemp_max_caller = tcb->preemp_caller; CHECK_PREEMPTION(tcb->pid, elapsed); } @@ -361,9 +361,9 @@ void nxsched_suspend_critmon(FAR struct tcb_s *tcb) * re-open in nxsched_resume_critmon. */ - if (elapsed > g_premp_max[cpu]) + if (elapsed > g_preemp_max[cpu]) { - g_premp_max[cpu] = elapsed; + g_preemp_max[cpu] = elapsed; } } #endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION */