mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Display dump file size change in the update utility.
This commit is contained in:
parent
f8ef5b726a
commit
d49b005900
1
NEWS
1
NEWS
@ -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)
|
||||||
-------------------
|
-------------------
|
||||||
|
@ -50,18 +50,31 @@ int main( int argc, char** argv )
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tracy::Worker worker( *f );
|
int inVer;
|
||||||
|
|
||||||
auto w = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output, hc ? tracy::FileWrite::Compression::Slow : tracy::FileWrite::Compression::Fast ) );
|
|
||||||
if( !w )
|
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Cannot open output file!\n" );
|
tracy::Worker worker( *f );
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
worker.Write( *w );
|
|
||||||
|
|
||||||
const auto inVer = worker.GetTraceVersion();
|
auto w = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output, hc ? tracy::FileWrite::Compression::Slow : tracy::FileWrite::Compression::Fast ) );
|
||||||
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 );
|
if( !w )
|
||||||
|
{
|
||||||
|
fprintf( stderr, "Cannot open output file!\n" );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
|
worker.Write( *w );
|
||||||
|
inVer = worker.GetTraceVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE* in = fopen( input, "rb" );
|
||||||
|
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 )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user