Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoshuakr <joshuakr@nvidia.com>2021-01-22 05:32:03 +0300
committerjoshuakr <joshuakr@nvidia.com>2021-01-22 05:33:59 +0300
commitc96f01956da41130f60efa75d9afa6730025cbb0 (patch)
tree6a9b766455effda82590bf2a3c482db8bd85f109 /import-chrome
parentdb83fc443f1bfbb2326787d8a058965e75a3cb4c (diff)
PR feedback: write the name into the tracy file
Diffstat (limited to 'import-chrome')
-rw-r--r--import-chrome/src/import-chrome.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/import-chrome/src/import-chrome.cpp b/import-chrome/src/import-chrome.cpp
index a03888d9..d17653a9 100644
--- a/import-chrome/src/import-chrome.cpp
+++ b/import-chrome/src/import-chrome.cpp
@@ -194,11 +194,15 @@ int main( int argc, char** argv )
printf( "\33[2KProcessing...\r" );
fflush( stdout );
- auto program = input;
- while( *program ) program++;
- program--;
- while( program > input && ( *program != '/' || *program != '\\' ) ) program--;
- tracy::Worker worker( program, timeline, messages, plots, threadNames );
+ auto&& getFilename = [](const char* in) {
+ auto out = in;
+ while (*out) ++out;
+ --out;
+ while (out > in && (*out != '/' || *out != '\\')) out--;
+ return out;
+ };
+
+ tracy::Worker worker( getFilename(output), getFilename(input), timeline, messages, plots, threadNames );
auto w = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output, clev ) );
if( !w )