mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Check if core_id and die_id exist.
This commit is contained in:
parent
ea4de3be36
commit
11777e8136
@ -3901,17 +3901,23 @@ void Profiler::ReportTopology()
|
||||
|
||||
sprintf( path, "%s%i/topology/core_id", basePath, i );
|
||||
f = fopen( path, "rb" );
|
||||
read = fread( buf, 1, 1024, f );
|
||||
buf[read] = '\0';
|
||||
fclose( f );
|
||||
cpuData[i].core = uint32_t( atoi( buf ) );
|
||||
if( f )
|
||||
{
|
||||
read = fread( buf, 1, 1024, f );
|
||||
buf[read] = '\0';
|
||||
fclose( f );
|
||||
cpuData[i].core = uint32_t( atoi( buf ) );
|
||||
}
|
||||
|
||||
sprintf( path, "%s%i/topology/die_id", basePath, i );
|
||||
f = fopen( path, "rb" );
|
||||
read = fread( buf, 1, 1024, f );
|
||||
buf[read] = '\0';
|
||||
fclose( f );
|
||||
cpuData[i].die = uint32_t( atoi( buf ) );
|
||||
if( f )
|
||||
{
|
||||
read = fread( buf, 1, 1024, f );
|
||||
buf[read] = '\0';
|
||||
fclose( f );
|
||||
cpuData[i].die = uint32_t( atoi( buf ) );
|
||||
}
|
||||
}
|
||||
|
||||
for( int i=0; i<numcpus; i++ )
|
||||
|
Loading…
Reference in New Issue
Block a user