Changeset View
Changeset View
Standalone View
Standalone View
source/ps/Util.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | void WriteSystemInfo() | ||||
// OS | // OS | ||||
fprintf(f, "OS : %s %s (%s)\n", un.sysname, un.release, un.version); | fprintf(f, "OS : %s %s (%s)\n", un.sysname, un.release, un.version); | ||||
// CPU | // CPU | ||||
fprintf(f, "CPU : %s, %s", un.machine, cpu_IdentifierString()); | fprintf(f, "CPU : %s, %s", un.machine, cpu_IdentifierString()); | ||||
#if ARCH_X86_X64 | #if ARCH_X86_X64 | ||||
fprintf(f, " (%dx%dx%d)", (int)topology::NumPackages(), (int)topology::CoresPerPackage(), (int)topology::LogicalPerCore()); | fprintf(f, " (%dx%dx%d)", (int)topology::NumPackages(), (int)topology::CoresPerPackage(), (int)topology::LogicalPerCore()); | ||||
#endif | #endif | ||||
double cpuClock = os_cpu_ClockFrequency(); // query OS (may fail) | |||||
#if ARCH_X86_X64 | |||||
if(cpuClock <= 0.0) | |||||
cpuClock = x86_x64::ClockFrequency(); // measure (takes a few ms) | |||||
#endif | |||||
if(cpuClock > 0.0) | |||||
{ | |||||
if(cpuClock < 1e9) | |||||
fprintf(f, ", %.2f MHz\n", cpuClock*1e-6); | |||||
else | |||||
fprintf(f, ", %.2f GHz\n", cpuClock*1e-9); | |||||
} | |||||
else | |||||
fprintf(f, "\n"); | |||||
// memory | // memory | ||||
fprintf(f, "Memory : %u MiB; %u MiB free\n", (unsigned)os_cpu_MemorySize(), (unsigned)os_cpu_MemoryAvailable()); | fprintf(f, "Memory : %u MiB; %u MiB free\n", (unsigned)os_cpu_MemorySize(), (unsigned)os_cpu_MemoryAvailable()); | ||||
// graphics | // graphics | ||||
const std::wstring cardName = gfx::CardName(); | const std::wstring cardName = gfx::CardName(); | ||||
const std::wstring driverInfo = gfx::DriverInfo(); | const std::wstring driverInfo = gfx::DriverInfo(); | ||||
fprintf(f, "Graphics Card : %ls\n", cardName.c_str()); | fprintf(f, "Graphics Card : %ls\n", cardName.c_str()); | ||||
▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator