F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Os::SystemResources Namespace Reference

Classes

struct  CpuTicks
 
struct  MemUtil
 

Enumerations

enum  SystemResourcesStatus { SYSTEM_RESOURCES_OK , SYSTEM_RESOURCES_ERROR }
 

Functions

SystemResourcesStatus getCpuCount (U32 &cpu_count)
 Request the count of the CPUs detected by the system. More...
 
SystemResourcesStatus getCpuTicks (CpuTicks &ticks, U32 cpu_index=0)
 Get the CPU tick information for a given CPU. More...
 
SystemResourcesStatus getMemUtil (MemUtil &memory_util)
 Get system memory usage. More...
 

Enumeration Type Documentation

◆ SystemResourcesStatus

Enumerator
SYSTEM_RESOURCES_OK 

Call was successful.

SYSTEM_RESOURCES_ERROR 

Call failed.

Definition at line 20 of file SystemResources.hpp.

Function Documentation

◆ getCpuCount()

SystemResources::SystemResourcesStatus Os::SystemResources::getCpuCount ( U32 &  cpu_count)

Request the count of the CPUs detected by the system.

Parameters
cpu_count(output) filled with CPU count on system
Returns
: SYSTEM_RESOURCES_OK with valid CPU count, SYSTEM_RESOURCES_ERROR when error occurs

Definition at line 17 of file SystemResources.cpp.

◆ getCpuTicks()

SystemResources::SystemResourcesStatus Os::SystemResources::getCpuTicks ( CpuTicks ticks,
U32  cpu_index = 0 
)

Get the CPU tick information for a given CPU.

CPU ticks represent a small time slice of processor time. This will retrieve the used CPU ticks and total ticks for a given CPU. This information in a running accumulation and thus a sample-to-sample differencing is needed to see the 'realtime' changing load. This shall be done by the caller.

Parameters
ticks(output) filled with the tick information for the given CPU
cpu_indexindex for CPU to read
Returns
: SYSTEM_RESOURCES_ERROR when error occurs, SYSTEM_RESOURCES_OK otherwise.

Definition at line 23 of file SystemResources.cpp.

◆ getMemUtil()

SystemResources::SystemResourcesStatus Os::SystemResources::getMemUtil ( MemUtil memory_util)

Get system memory usage.

Parameters
memory_util(output) data structure used to store memory usage
Returns
: SYSTEM_RESOURCES_ERROR when error occurs, SYSTEM_RESOURCES_OK otherwise.

Definition at line 31 of file SystemResources.cpp.