Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions sched/sched/sched_critmonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ static void nxsched_critmon_cpuload(FAR struct tcb_s *tcb, clock_t current,
clock_t tick)
{
int i;

UNUSED(i);

/* Update the cpuload of the thread ready to be suspended */
Expand Down Expand Up @@ -374,13 +375,13 @@ void nxsched_switch_critmon(FAR struct tcb_s *from, FAR struct tcb_s *to)

#ifdef CONFIG_SCHED_CPULOAD_CRITMONITOR
clock_t tick = elapsed * CLOCKS_PER_SEC / perf_getfreq();

nxsched_critmon_cpuload(from, current, tick);
to->run_start = current;
#endif

#if CONFIG_SCHED_CRITMONITOR_MAXTIME_THREAD >= 0
from->run_time += elapsed;
to->run_time = current;
to->run_start = current;
if (elapsed > from->run_max)
{
from->run_max = elapsed;
Expand Down Expand Up @@ -418,7 +419,7 @@ void nxsched_switch_critmon(FAR struct tcb_s *from, FAR struct tcb_s *to)

if (to->lockcount > 0)
{
to->premp_start = current;
to->preemp_start = current;
}
#endif /* CONFIG_SCHED_CRITMONITOR_MAXTIME_PREEMPTION */

Expand Down Expand Up @@ -465,6 +466,7 @@ void nxsched_update_critmon(FAR struct tcb_s *tcb)
{
#ifdef CONFIG_SCHED_CPULOAD_CRITMONITOR
clock_t tick = elapsed * CLOCKS_PER_SEC / perf_getfreq();

nxsched_process_taskload_ticks(tcb, tick);
#endif

Expand Down
8 changes: 4 additions & 4 deletions tools/pynuttx/nxgdb/protocols/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ class Tcb(Value):
run_start: Value
run_max: Value
run_time: Value
premp_start: Value
premp_max: Value
premp_caller: Value
premp_max_caller: Value
preemp_start: Value
preemp_max: Value
preemp_caller: Value
preemp_max_caller: Value
crit_start: Value
crit_max: Value
crit_caller: Value
Expand Down
Loading