diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-03-30 17:08:20 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-03-30 17:08:20 +0300 |
commit | 8532c2d1e0d0f9f1af6d6f82ceb6e2ff0ef729a3 (patch) | |
tree | d67c88f0aa5d2098b65b12eb8152707113be46ed /update | |
parent | a335efe9e6be3f58eda2613484cdd3cd0ec023f1 (diff) |
Expose source file scan in update utility.
Diffstat (limited to 'update')
-rw-r--r-- | update/src/update.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/update/src/update.cpp b/update/src/update.cpp index 0823fea8..62a30ebd 100644 --- a/update/src/update.cpp +++ b/update/src/update.cpp @@ -31,6 +31,7 @@ void Usage() printf( " -s flags: strip selected data from capture:\n" ); printf( " l: locks, m: messages, p: plots, M: memory, i: frame images\n" ); printf( " c: context switches, s: sampling data, C: symbol code, S: source cache\n" ); + printf( " -c: scan for source files missing in cache and add if found\n" ); exit( 1 ); } @@ -48,8 +49,9 @@ int main( int argc, char** argv ) uint32_t events = tracy::EventType::All; int zstdLevel = 1; bool buildDict = false; + bool cacheSource = false; int c; - while( ( c = getopt( argc, argv, "hez:ds:" ) ) != -1 ) + while( ( c = getopt( argc, argv, "hez:ds:c" ) ) != -1 ) { switch( c ) { @@ -113,6 +115,9 @@ int main( int argc, char** argv ) while( *++optarg != '\0' ); break; } + case 'c': + cacheSource = true; + break; default: Usage(); break; @@ -145,6 +150,8 @@ int main( int argc, char** argv ) while( !worker.AreSourceLocationZonesReady() ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) ); #endif + if( cacheSource ) worker.CacheSourceFiles(); + auto w = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output, clev, zstdLevel ) ); if( !w ) { |