mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Check mtime of profiled executable.
This commit is contained in:
parent
2890f24c97
commit
0ce113a96c
@ -57,6 +57,7 @@
|
|||||||
#include <new>
|
#include <new>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include "../common/TracyAlign.hpp"
|
#include "../common/TracyAlign.hpp"
|
||||||
@ -1260,6 +1261,17 @@ void Profiler::Worker()
|
|||||||
|
|
||||||
rpmalloc_thread_initialize();
|
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 procname = GetProcessName();
|
||||||
const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
|
const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
|
||||||
|
|
||||||
|
@ -759,7 +759,7 @@ private:
|
|||||||
uint64_t m_delay;
|
uint64_t m_delay;
|
||||||
std::atomic<int64_t> m_timeBegin;
|
std::atomic<int64_t> m_timeBegin;
|
||||||
uint64_t m_mainThread;
|
uint64_t m_mainThread;
|
||||||
uint64_t m_epoch;
|
uint64_t m_epoch, m_exectime;
|
||||||
std::atomic<bool> m_shutdown;
|
std::atomic<bool> m_shutdown;
|
||||||
std::atomic<bool> m_shutdownManual;
|
std::atomic<bool> m_shutdownManual;
|
||||||
std::atomic<bool> m_shutdownFinished;
|
std::atomic<bool> m_shutdownFinished;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user