mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Check mtime of profiled executable.
This commit is contained in:
parent
2890f24c97
commit
0ce113a96c
@ -57,6 +57,7 @@
|
||||
#include <new>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <thread>
|
||||
|
||||
#include "../common/TracyAlign.hpp"
|
||||
@ -1260,6 +1261,17 @@ void Profiler::Worker()
|
||||
|
||||
rpmalloc_thread_initialize();
|
||||
|
||||
m_exectime = 0;
|
||||
const auto execname = GetProcessExecutablePath();
|
||||
if( execname )
|
||||
{
|
||||
struct stat st;
|
||||
if( stat( execname, &st ) == 0 )
|
||||
{
|
||||
m_exectime = (uint64_t)st.st_mtime;
|
||||
}
|
||||
}
|
||||
|
||||
const auto procname = GetProcessName();
|
||||
const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
|
||||
|
||||
|
@ -759,7 +759,7 @@ private:
|
||||
uint64_t m_delay;
|
||||
std::atomic<int64_t> m_timeBegin;
|
||||
uint64_t m_mainThread;
|
||||
uint64_t m_epoch;
|
||||
uint64_t m_epoch, m_exectime;
|
||||
std::atomic<bool> m_shutdown;
|
||||
std::atomic<bool> m_shutdownManual;
|
||||
std::atomic<bool> m_shutdownFinished;
|
||||
|
Loading…
Reference in New Issue
Block a user