Motorcortex Core  version: 2.7.6
Utils

Detailed Description

Various helper functions.

Functions

bool mcx::utils::configureMallocBehavior (size_t size_mb)
 Configures memory behavior for Real-time. More...
 
void mcx::utils::signalCallbackHandler (int)
 
bool mcx::utils::running ()
 
bool mcx::utils::setSwappiness (size_t swappiness)
 
bool mcx::utils::setPrintkLevel (size_t level)
 
bool mcx::utils::setCpuFreqPolicy (unsigned int cpu_id, const char *governor)
 
bool mcx::utils::startRealTime (size_t size_mb)
 
bool mcx::utils::startRealTime (const std::vector< uint32_t > &cpu_list, size_t size_mb=256)
 Activates Real-time mode and isolates CPUs. More...
 
bool mcx::utils::startRealTime (cmd_line::Realtime opt)
 Activates Real-time mode and isolates CPUs. More...
 
bool mcx::utils::startRealTime ()
 Activates Real-time mode and isolates CPUs. More...
 
void mcx::utils::stopRealTime (cmd_line::Realtime opt)
 Deactivate Real-time mode, removes CPUs' isolation. More...
 
void mcx::utils::stopRealTime ()
 Deactivate Real-time mode, removes CPUs' isolation.
 

Function Documentation

◆ configureMallocBehavior()

bool mcx::utils::configureMallocBehavior ( size_t  size_mb)

Configures memory behavior for Real-time.

Locks all current and future pages from preventing of being paged. Touches each page in this piece of memory to get it mapped into RAM.

Parameters
size_mb- size of RAM to reserve in Megabytes.
Returns
true on success.

◆ running()

bool mcx::utils::running ( )

Indicates that process is running.

Returns
true if no system terminate signals have been received.

◆ startRealTime() [1/3]

bool mcx::utils::startRealTime ( )

Activates Real-time mode and isolates CPUs.

Returns
true on success

◆ startRealTime() [2/3]

bool mcx::utils::startRealTime ( cmd_line::Realtime  opt)

Activates Real-time mode and isolates CPUs.

@opt - struct with realtime options.

Returns
true on success

◆ startRealTime() [3/3]

bool mcx::utils::startRealTime ( const std::vector< uint32_t > &  cpu_list,
size_t  size_mb = 256 
)

Activates Real-time mode and isolates CPUs.

@cpu_list - list of the CPUs to isolate.

Parameters
size_mb- size of RAM to reserve in Megabytes.
Returns
true on success

◆ stopRealTime()

void mcx::utils::stopRealTime ( cmd_line::Realtime  opt)

Deactivate Real-time mode, removes CPUs' isolation.

@opt - struct with realtime options.