F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
SystemResources.cpp File Reference
#include <cstdio>
#include <cstring>
#include <sys/sysinfo.h>
#include <Os/SystemResources.hpp>
#include <Fw/Types/Assert.hpp>

Go to the source code of this file.

Namespaces

 Os
 

Functions

U64 Os::getCpuUsed (U32 cpu_data[4])
 
U64 Os::getCpuTotal (U32 cpu_data[4])
 
SystemResources::SystemResourcesStatus Os::openProcStatFile (FILE *&fp)
 
SystemResources::SystemResourcesStatus Os::readProcStatLine (FILE *fp, char proc_stat_line[LINE_SIZE])
 
SystemResources::SystemResourcesStatus Os::getCpuDataLine (FILE *fp, U32 cpu_index, char proc_stat_line[LINE_SIZE])
 
SystemResources::SystemResourcesStatus Os::parseCpuData (char proc_stat_line[LINE_SIZE], U32 cpu_data[4])
 
SystemResources::SystemResourcesStatus Os::getCpuData (U32 cpu_index, U32 cpu_data[4])
 
U64 Os::getMemoryTotal (FwSizeType total_ram, FwSizeType memory_unit)
 
U64 Os::getMemoryUsed (FwSizeType total_ram, FwSizeType free_ram, FwSizeType memory_unit)
 
bool Os::checkCastingAndTypeErrors (FwSizeType total_ram, FwSizeType free_ram, FwSizeType memory_unit, const struct sysinfo &memory_info)
 
bool Os::checkInvalidMemoryCalculation (FwSizeType total_ram, FwSizeType free_ram)
 
bool Os::checkMultiplicationOverflow (FwSizeType total_ram, FwSizeType memory_unit)
 

Variables

constexpr char PROC_STAT_PATH [] = "/proc/stat"
 
constexpr char READ_ONLY [] = "r"
 
constexpr int LINE_SIZE = 256
 
char proc_stat_line [LINE_SIZE]
 

Variable Documentation

◆ LINE_SIZE

constexpr int LINE_SIZE = 256
constexpr

Definition at line 20 of file SystemResources.cpp.

◆ proc_stat_line

char proc_stat_line[LINE_SIZE]

Definition at line 21 of file SystemResources.cpp.

◆ PROC_STAT_PATH

constexpr char PROC_STAT_PATH[] = "/proc/stat"
constexpr

Definition at line 18 of file SystemResources.cpp.

◆ READ_ONLY

constexpr char READ_ONLY[] = "r"
constexpr

Definition at line 19 of file SystemResources.cpp.