nub_bool_t MachVMMemory::GetMemoryProfile(DNBProfileDataScanType scanType, task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, vm_statistics_data_t &vm_stats, uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size, mach_vm_size_t &purgeable, mach_vm_size_t &anonymous) { if (scanType & eProfileHostMemory) physical_memory = GetPhysicalMemory(); if (scanType & eProfileMemory) { static mach_port_t localHost = mach_host_self(); mach_msg_type_number_t count = HOST_VM_INFO_COUNT; host_statistics(localHost, HOST_VM_INFO, (host_info_t)&vm_stats, &count); vm_stats.wire_count += GetStolenPages(task); GetMemorySizes(task, cputype, pid, rprvt, vprvt); rsize = ti.resident_size; vsize = ti.virtual_size; if (scanType & eProfileMemoryDirtyPage) { // This uses vmmap strategy. We don't use the returned rsize for now. We prefer to match top's version since that's what we do for the rest of the metrics. GetRegionSizes(task, rsize, dirty_size); } if (scanType & eProfileMemoryAnonymous) { GetPurgeableAndAnonymous(task, purgeable, anonymous); } } return true; }
void TRI_InitializeProcess (int argc, char* argv[]) { TRI_PhysicalMemory = GetPhysicalMemory(); if (ProcessName != nullptr) { return; } ProcessName = TRI_DuplicateString(argv[0]); ARGC = argc; ARGV = argv; TRI_InitVectorPointer(&ExternalProcesses, TRI_CORE_MEM_ZONE); TRI_InitMutex(&ExternalProcessesLock); }
// This function should be called once during program execution. void SysLogMachineCaps() { if ( !PCSX2_isReleaseVersion ) { Console.WriteLn(Color_StrongGreen, "PCSX2 %u.%u.%u.r%d %s - compiled on " __DATE__, PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_REV, SVN_MODS ? "(modded)" : "" ); } else { // shorter release version string Console.WriteLn(Color_StrongGreen, "PCSX2 %u.%u.%u.r%d - compiled on " __DATE__, PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_REV ); } Console.WriteLn( "Savestate version: 0x%x", g_SaveVersion); Console.Newline(); Console.WriteLn( Color_StrongBlack, "Host Machine Init:" ); Console.Indent().WriteLn( L"Operating System = %s\n" L"Physical RAM = %u MB", GetOSVersionString().c_str(), (u32)(GetPhysicalMemory() / _1mb) ); u32 speed = x86caps.CalculateMHz(); Console.Indent().WriteLn( L"CPU name = %s\n" L"Vendor/Model = %s (stepping %02X)\n" L"CPU speed = %u.%03u ghz (%u logical thread%s)\n" L"x86PType = %s\n" L"x86Flags = %08x %08x\n" L"x86EFlags = %08x", fromUTF8( x86caps.FamilyName ).Trim().Trim(false).c_str(), fromUTF8( x86caps.VendorName ).c_str(), x86caps.StepID, speed / 1000, speed % 1000, x86caps.LogicalCores, (x86caps.LogicalCores==1) ? L"" : L"s", x86caps.GetTypeName().c_str(), x86caps.Flags, x86caps.Flags2, x86caps.EFlags ); Console.Newline(); wxArrayString features[2]; // 2 lines, for readability! if( x86caps.hasMultimediaExtensions ) features[0].Add( L"MMX" ); if( x86caps.hasStreamingSIMDExtensions ) features[0].Add( L"SSE" ); if( x86caps.hasStreamingSIMD2Extensions ) features[0].Add( L"SSE2" ); if( x86caps.hasStreamingSIMD3Extensions ) features[0].Add( L"SSE3" ); if( x86caps.hasSupplementalStreamingSIMD3Extensions ) features[0].Add( L"SSSE3" ); if( x86caps.hasStreamingSIMD4Extensions ) features[0].Add( L"SSE4.1" ); if( x86caps.hasStreamingSIMD4Extensions2 ) features[0].Add( L"SSE4.2" ); if( x86caps.hasAVX ) features[0].Add( L"AVX" ); if( x86caps.hasFMA) features[0].Add( L"FMA" ); if( x86caps.hasMultimediaExtensionsExt ) features[1].Add( L"MMX2 " ); if( x86caps.has3DNOWInstructionExtensions ) features[1].Add( L"3DNOW " ); if( x86caps.has3DNOWInstructionExtensionsExt ) features[1].Add( L"3DNOW2" ); if( x86caps.hasStreamingSIMD4ExtensionsA ) features[1].Add( L"SSE4a " ); const wxString result[2] = { JoinString( features[0], L".. " ), JoinString( features[1], L".. " ) }; Console.WriteLn( Color_StrongBlack, L"x86 Features Detected:" ); Console.Indent().WriteLn( result[0] + (result[1].IsEmpty() ? L"" : (L"\n" + result[1])) ); Console.Newline(); }