1
0
mirror of https://github.com/wolfpld/tracy synced 2025-01-15 11:57:59 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Bartosz Taudul
6d8abfe640
Add utility for trace version identification. 2021-05-18 02:49:41 +02:00
Bartosz Taudul
5ec1313af1
Drop legacy code for reading long unsupported traces. 2021-05-18 02:24:56 +02:00
Bartosz Taudul
98551ab892
Simplify history a bit. 2021-05-18 02:20:19 +02:00
Bartosz Taudul
b7832a2510
Cherry-pick https://github.com/facebook/zstd/pull/2653 2021-05-18 02:10:30 +02:00
5 changed files with 61 additions and 23 deletions

7
NEWS
View File

@ -2,9 +2,6 @@ Note: There is no guarantee that version mismatched client and server will
be able to talk with each other. Network protocol breakages won't be listed
here.
Note: Release numbers are nothing more than numbers. There are some
"missing" versions due to trace file changes during development. This is not
a mistake.
v0.x.x (xxxx-xx-xx)
-------------------
@ -610,8 +607,8 @@ v0.4 (2018-10-09)
- The capture utility will now display time span of the ongoing capture.
v0.3.3 (2018-07-03)
-------------------
v0.3 (2018-07-03)
-----------------
- Breaking change: the format of trace files has changed.
- Previous tracy version will crash when trying to open new traces.

50
extra/identify.cpp Normal file
View File

@ -0,0 +1,50 @@
// g++ identify.cpp -lpthread ../common/tracy_lz4.cpp ../zstd/common/*.c ../zstd/decompress/*.c
#include <memory>
#include <stdint.h>
#include <stdio.h>
#include "../server/TracyFileRead.hpp"
#include "../server/TracyVersion.hpp"
static const uint8_t FileHeader[8] { 't', 'r', 'a', 'c', 'y', tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch };
enum { FileHeaderMagic = 5 };
int main( int argc, char** argv )
{
if( argc != 2 )
{
fprintf( stderr, "Usage: %s trace\n", argv[0] );
return -1;
}
try
{
std::unique_ptr<tracy::FileRead> f( tracy::FileRead::Open( argv[1] ) );
if( !f )
{
fprintf( stderr, "%s: Cannot open!\n", argv[1] );
return -2;
}
uint8_t hdr[8];
f->Read( hdr, sizeof( hdr ) );
if( memcmp( FileHeader, hdr, FileHeaderMagic ) != 0 )
{
fprintf( stderr, "%s: Bad header!\n", argv[1] );
return -3;
}
printf( "%s: %i.%i.%i\n", argv[1], hdr[FileHeaderMagic], hdr[FileHeaderMagic+1], hdr[FileHeaderMagic+2] );
}
catch( const tracy::NotTracyDump& )
{
fprintf( stderr, "%s: Not a tracy dump!\n", argv[1] );
return -4;
}
catch( const tracy::FileReadError& )
{
fprintf( stderr, "%s: File read error!\n", argv[1] );
return -5;
}
}

View File

@ -24,26 +24,17 @@ void ThreadCompress::Load( FileRead& f, int fileVer )
assert( m_threadMap.empty() );
uint64_t sz;
if( fileVer >= FileVersion( 0, 4, 4 ) )
f.Read( sz );
if( sz != 0 )
{
f.Read( sz );
if( sz != 0 )
m_threadExpand.reserve_and_use( sz );
f.Read( m_threadExpand.data(), sizeof( uint64_t ) * sz );
m_threadMap.reserve( sz );
for( size_t i=0; i<sz; i++ )
{
m_threadExpand.reserve_and_use( sz );
f.Read( m_threadExpand.data(), sizeof( uint64_t ) * sz );
m_threadMap.reserve( sz );
for( size_t i=0; i<sz; i++ )
{
m_threadMap.emplace( m_threadExpand[i], i );
}
m_threadMap.emplace( m_threadExpand[i], i );
}
}
else
{
f.Read( sz );
m_threadExpand.reserve( sz );
m_threadExpand.push_back( 0 );
}
}
void ThreadCompress::Save( FileWrite& f ) const

View File

@ -222,7 +222,7 @@ static int ZSTD_rowMatchFinderUsed(const ZSTD_strategy strategy, const ZSTD_useR
/* Returns row matchfinder usage enum given an initial mode and cParams */
static ZSTD_useRowMatchFinderMode_e ZSTD_resolveRowMatchFinderMode(ZSTD_useRowMatchFinderMode_e mode,
const ZSTD_compressionParameters* const cParams) {
#if !defined(ZSTD_NO_INTRINSICS) && (defined(__SSE2__) || defined(__ARM_NEON))
#if !defined(ZSTD_NO_INTRINSICS) && (defined(__SSE2__) || defined(_M_AMD64) || defined(__ARM_NEON))
int const kHasSIMD128 = 1;
#else
int const kHasSIMD128 = 0;

View File

@ -873,7 +873,7 @@ FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch_extDict_selectMLS (
typedef U32 ZSTD_VecMask; /* Clarifies when we are interacting with a U32 representing a mask of matches */
#if !defined(ZSTD_NO_INTRINSICS) && defined(__SSE2__) /* SIMD SSE version */
#if !defined(ZSTD_NO_INTRINSICS) && (defined(__SSE2__) || defined(_M_AMD64)) /* SIMD SSE version */
#include <emmintrin.h>
typedef __m128i ZSTD_Vec128;