mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
PR feedback: write the name into the tracy file
This commit is contained in:
parent
db83fc443f
commit
c96f01956d
@ -194,11 +194,15 @@ int main( int argc, char** argv )
|
|||||||
printf( "\33[2KProcessing...\r" );
|
printf( "\33[2KProcessing...\r" );
|
||||||
fflush( stdout );
|
fflush( stdout );
|
||||||
|
|
||||||
auto program = input;
|
auto&& getFilename = [](const char* in) {
|
||||||
while( *program ) program++;
|
auto out = in;
|
||||||
program--;
|
while (*out) ++out;
|
||||||
while( program > input && ( *program != '/' || *program != '\\' ) ) program--;
|
--out;
|
||||||
tracy::Worker worker( program, timeline, messages, plots, threadNames );
|
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 ) );
|
auto w = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output, clev ) );
|
||||||
if( !w )
|
if( !w )
|
||||||
|
@ -275,10 +275,11 @@ Worker::Worker( const char* addr, uint16_t port )
|
|||||||
m_threadNet = std::thread( [this] { SetThreadName( "Tracy Network" ); Network(); } );
|
m_threadNet = std::thread( [this] { SetThreadName( "Tracy Network" ); Network(); } );
|
||||||
}
|
}
|
||||||
|
|
||||||
Worker::Worker( const std::string& program, const std::vector<ImportEventTimeline>& timeline, const std::vector<ImportEventMessages>& messages, const std::vector<ImportEventPlots>& plots, const std::unordered_map<uint64_t, std::string>& threadNames )
|
Worker::Worker( const char* name, const char* program, const std::vector<ImportEventTimeline>& timeline, const std::vector<ImportEventMessages>& messages, const std::vector<ImportEventPlots>& plots, const std::unordered_map<uint64_t, std::string>& threadNames )
|
||||||
: m_hasData( true )
|
: m_hasData( true )
|
||||||
, m_delay( 0 )
|
, m_delay( 0 )
|
||||||
, m_resolution( 0 )
|
, m_resolution( 0 )
|
||||||
|
, m_captureName( name )
|
||||||
, m_captureProgram( program )
|
, m_captureProgram( program )
|
||||||
, m_captureTime( 0 )
|
, m_captureTime( 0 )
|
||||||
, m_pid( 0 )
|
, m_pid( 0 )
|
||||||
|
@ -395,7 +395,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Worker( const char* addr, uint16_t port );
|
Worker( const char* addr, uint16_t port );
|
||||||
Worker( const std::string& program, const std::vector<ImportEventTimeline>& timeline, const std::vector<ImportEventMessages>& messages, const std::vector<ImportEventPlots>& plots, const std::unordered_map<uint64_t, std::string>& threadNames );
|
Worker( const char* name, const char* program, const std::vector<ImportEventTimeline>& timeline, const std::vector<ImportEventMessages>& messages, const std::vector<ImportEventPlots>& plots, const std::unordered_map<uint64_t, std::string>& threadNames );
|
||||||
Worker( FileRead& f, EventType::Type eventMask = EventType::All, bool bgTasks = true );
|
Worker( FileRead& f, EventType::Type eventMask = EventType::All, bool bgTasks = true );
|
||||||
~Worker();
|
~Worker();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user