Skip to main content

Module task_census

Module task_census 

Source
Expand description

The boot task census of a Linux process (/proc/self/task), one reader for both Linux runners. Linux only, as env is. The boot task census of a Linux process: every thread with its scheduling policy and real-time priority, as the RTOS runners print theirs (FreeRTOS, NuttX, ThreadX):

nros: task census name=`<comm>` prio=<rt_priority> policy=<FIFO|RR|OTHER|...>
nros: task census done tasks=<n>

Read from /proc/self/task/<tid>/{comm,stat}, through the C library and not std, for the reason crate::env gives: the edge is “a C library is linked”, which on this tree is target_os = "linux". ONE reader serves both Linux runners, the Rust board’s (nros-board-linux) and the C/C++ one (nros-cpp), which do not share a board crate.

prio is the real-time priority (stat field 40). A thread on a non-real-time policy has 0 there and sits outside every band of the priority plan by construction. The Linux plan states reserved.foreign = [], and this is what a test checks it against.

Functions§

report
Print the census through println, one call per line, ending with the done line. A thread that exits between the listing and the read is skipped; past MAX_THREADS (64) the rest are not reported.