scx_rustland: report nr_running metric to stdout

Report the amount of running tasks to stdout. This value also represents
the amount of active CPUs that are currently executing a task.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
This commit is contained in:
Andrea Righi 2024-05-20 04:42:07 +02:00
parent aae4ed5b46
commit 9a2cc6be50

View File

@ -681,13 +681,14 @@ impl<'a> Scheduler<'a> {
nr_cancel_dispatches, nr_bounce_dispatches, nr_cancel_dispatches, nr_bounce_dispatches,
); );
// Show tasks that are waiting to be dispatched. // Show tasks that are running or waiting to be dispatched.
let nr_running = *self.bpf.nr_running_mut();
let nr_queued = *self.bpf.nr_queued_mut(); let nr_queued = *self.bpf.nr_queued_mut();
let nr_scheduled = *self.bpf.nr_scheduled_mut(); let nr_scheduled = *self.bpf.nr_scheduled_mut();
let nr_waiting = nr_queued + nr_scheduled; let nr_waiting = nr_queued + nr_scheduled;
info!( info!(
" nr_waiting={} [nr_queued={} + nr_scheduled={}]", " nr_running={} nr_waiting={} [nr_queued={} + nr_scheduled={}]",
nr_waiting, nr_queued, nr_scheduled nr_running, nr_waiting, nr_queued, nr_scheduled
); );
// Show total page faults of the user-space scheduler. // Show total page faults of the user-space scheduler.