F´ Flight Software - C/C++ Documentation  NASA-v2.1.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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)
 Calculate the across-all-cpu average tick information. 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 15 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_OK with valid CPU count, SYSTEM_RESOURCES_ERROR when error occurs

Definition at line 21 of file SystemResources.cpp.

◆ getMemUtil()

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

Calculate the across-all-cpu average tick information.

See getCpuTicks. Operates in a similar capacity, but the aggregation is done across all CPUs not for a specific CPU.

Parameters
ticks(output) filled with the tick information for the given CPU
Returns
: SYSTEM_RESOURCES_OK with valid CPU count, SYSTEM_RESOURCES_ERROR when error occurs

Definition at line 29 of file SystemResources.cpp.