mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Display CPU info.
This commit is contained in:
parent
6fda74e281
commit
eab3adfa1d
@ -13134,6 +13134,27 @@ void View::DrawInfo()
|
||||
TextFocused( "PID:", RealToString( m_worker.GetPid() ) );
|
||||
TextFocused( "Host info:", m_worker.GetHostInfo().c_str() );
|
||||
|
||||
const auto cpuId = m_worker.GetCpuId();
|
||||
if( cpuId != 0 )
|
||||
{
|
||||
const auto stepping = cpuId & 0xF;
|
||||
const auto baseModel = ( cpuId >> 4 ) & 0xF;
|
||||
const auto baseFamily = ( cpuId >> 8 ) & 0xF;
|
||||
const auto extModel = ( cpuId >> 12 ) & 0xF;
|
||||
const auto extFamily = ( cpuId >> 16 );
|
||||
|
||||
const uint32_t model = ( baseFamily == 6 || baseFamily == 15 ) ? ( ( extModel << 4 ) | baseModel ) : baseModel;
|
||||
const uint32_t family = baseFamily == 15 ? baseFamily + extFamily : baseFamily;
|
||||
|
||||
TextFocused( "CPU:", m_worker.GetCpuManufacturer() );
|
||||
ImGui::SameLine();
|
||||
TextFocused( "Family", RealToString( family ) );
|
||||
ImGui::SameLine();
|
||||
TextFocused( "Model", RealToString( model ) );
|
||||
ImGui::SameLine();
|
||||
TextFocused( "Stepping", RealToString( stepping ) );
|
||||
}
|
||||
|
||||
auto& appInfo = m_worker.GetAppInfo();
|
||||
if( !appInfo.empty() )
|
||||
{
|
||||
|
@ -377,6 +377,8 @@ public:
|
||||
int64_t GetResolution() const { return m_resolution; }
|
||||
uint64_t GetPid() const { return m_pid; };
|
||||
CpuArchitecture GetCpuArch() const { return m_data.cpuArch; }
|
||||
uint32_t GetCpuId() const { return m_data.cpuId; }
|
||||
const char* GetCpuManufacturer() const { return m_data.cpuManufacturer; }
|
||||
|
||||
std::shared_mutex& GetDataLock() { return m_data.lock; }
|
||||
size_t GetFrameCount( const FrameData& fd ) const { return fd.frames.size(); }
|
||||
|
Loading…
Reference in New Issue
Block a user