1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-01 13:13:53 +00:00

Display dump file size change in the update utility.

This commit is contained in:
Bartosz Taudul 2018-12-30 23:14:00 +01:00
parent f8ef5b726a
commit d49b005900
2 changed files with 24 additions and 10 deletions

1
NEWS
View File

@ -10,6 +10,7 @@ v0.5 (xxxx-xx-xx)
----------------- -----------------
- Major decrease of trace dump file size. - Major decrease of trace dump file size.
- Display dump file size change in the update utility.
v0.4.1 (2018-12-30) v0.4.1 (2018-12-30)
------------------- -------------------

View File

@ -49,6 +49,8 @@ int main( int argc, char** argv )
} }
try try
{
int inVer;
{ {
tracy::Worker worker( *f ); tracy::Worker worker( *f );
@ -59,9 +61,20 @@ int main( int argc, char** argv )
exit( 1 ); exit( 1 );
} }
worker.Write( *w ); worker.Write( *w );
inVer = worker.GetTraceVersion();
}
const auto inVer = worker.GetTraceVersion(); FILE* in = fopen( input, "rb" );
printf( "%s (%i.%i.%i) -> %s (%i.%i.%i)\n", input, inVer >> 16, ( inVer >> 8 ) & 0xFF, inVer & 0xFF, output, tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch ); fseek( in, 0, SEEK_END );
const auto inSize = ftell( in );
fclose( in );
FILE* out = fopen( output, "rb" );
fseek( out, 0, SEEK_END );
const auto outSize = ftell( out );
fclose( out );
printf( "%s (%i.%i.%i) {%zu KB} -> %s (%i.%i.%i) {%zu KB} %.2f%% size change\n", input, inVer >> 16, ( inVer >> 8 ) & 0xFF, inVer & 0xFF, inSize / 1024, output, tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, outSize / 1024, float( outSize ) / inSize * 100 );
} }
catch( const tracy::UnsupportedVersion& e ) catch( const tracy::UnsupportedVersion& e )
{ {