Skip to content
Snippets Groups Projects
Commit 857bda17 authored by Burlen Loring's avatar Burlen Loring Committed by Brad King
Browse files

SystemInformation: Report more information

Support probing of the current process memory usage in KB
(linux,win,mac), the total physical memory in KB (linux,win,mac), and
the model name field of the cpuinfo (Linux only).  Add a method to
return the host's FQDN (non-AIX), and methods to test for OS type
(Windows, Apple, Linux).

Change-Id: Iedb238f4ca49d5f13385a71a592ec67cec73b29c
parent 63cbea35
No related branches found
No related tags found
No related merge requests found
......@@ -802,9 +802,10 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS})
ENDIF(UNIX)
ENDIF(KWSYS_USE_DynamicLoader)
IF(KWSYS_USE_SystemInformation AND WIN32)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ws2_32)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} Psapi)
ENDIF(KWSYS_USE_SystemInformation AND WIN32)
# Apply user-defined target properties to the library.
......
This diff is collapsed.
......@@ -25,10 +25,10 @@ namespace @KWSYS_NAMESPACE@
{
// forward declare the implementation class
// forward declare the implementation class
class SystemInformationImplementation;
class @KWSYS_NAMESPACE@_EXPORT SystemInformation
class @KWSYS_NAMESPACE@_EXPORT SystemInformation
{
public:
......@@ -40,6 +40,7 @@ public:
kwsys_stl::string GetTypeID();
kwsys_stl::string GetFamilyID();
kwsys_stl::string GetModelID();
kwsys_stl::string GetModelName();
kwsys_stl::string GetSteppingCode();
const char * GetExtendedProcessorName();
const char * GetProcessorSerialNumber();
......@@ -49,13 +50,27 @@ public:
int GetProcessorAPICID();
int GetProcessorCacheXSize(long int);
bool DoesCPUSupportFeature(long int);
const char * GetOSName();
// returns an informative general description of the cpu
// on this system.
kwsys_stl::string GetCPUDescription();
const char * GetHostname();
kwsys_stl::string GetFullyQualifiedDomainName();
const char * GetOSName();
const char * GetOSRelease();
const char * GetOSVersion();
const char * GetOSPlatform();
int GetOSIsWindows();
int GetOSIsLinux();
int GetOSIsApple();
// returns an informative general description of the os
// on this system.
kwsys_stl::string GetOSDescription();
bool Is64Bits();
unsigned int GetNumberOfLogicalCPU(); // per physical cpu
......@@ -63,11 +78,26 @@ public:
bool DoesCPUSupportCPUID();
// Retrieve id of the current running process
long long GetProcessId();
// Retrieve memory information in megabyte.
size_t GetTotalVirtualMemory();
size_t GetAvailableVirtualMemory();
size_t GetTotalPhysicalMemory();
size_t GetAvailablePhysicalMemory();
size_t GetAvailablePhysicalMemory();
// returns an informative general description if the ram
// on this system
kwsys_stl::string GetMemoryDescription();
// Retrieve physical memory information in kib
long long GetMemoryTotal();
long long GetMemoryUsed();
// enable/disable stack trace signal handler.
static
void SetStackTraceOnError(int enable);
/** Run the different checks */
void RunCPUCheck();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment