Utils

Utils

Various helper functions.

Functions

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

Functions Documentation

function configureMallocBehavior

bool configureMallocBehavior(
    size_t size_mb
)

Configures memory behavior for Real-time.

Parameters:

  • size_mb - size of RAM to reserve in Megabytes.

Return: true on success.

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.

function sig_initialized

static std::atomic< bool > sig_initialized(
    false 
)

function sig_terminated

static std::atomic< bool > sig_terminated(
    false 
)

function signalCallbackHandler

void signalCallbackHandler(
    int 
)

function running

bool running()

Return: true if no system terminate signals have been received.

Indicates that process is running.

function setSwappiness

bool setSwappiness(
    size_t swappiness
)

function setPrintkLevel

bool setPrintkLevel(
    size_t level
)

function setCpuFreqPolicy

bool setCpuFreqPolicy(
    unsigned int cpu_id,
    const char * governor
)

function startRealTime

bool startRealTime(
    size_t size_mb
)

function startRealTime

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

Activates Real-time mode and isolates CPUs.

Parameters:

  • size_mb - size of RAM to reserve in Megabytes.

Return: true on success

@cpu_list - list of the CPUs to isolate.

function startRealTime

bool startRealTime(
    cmd_line::Realtime opt
)

Activates Real-time mode and isolates CPUs.

Return: true on success

@opt - struct with realtime options.

function startRealTime

bool startRealTime()

Activates Real-time mode and isolates CPUs.

Return: true on success

function stopRealTime

void stopRealTime(
    cmd_line::Realtime opt
)

Deactivate Real-time mode, removes CPUs’ isolation.

@opt - struct with realtime options.

function stopRealTime

void stopRealTime()

Deactivate Real-time mode, removes CPUs’ isolation.


Updated on 2022-04-05 at 16:21:27 +0200

Last modified April 5, 2022: added autogenerated core api (928bfee2)