1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Allow source file modification time to be newer then trace capture time via checkbox

Useful on a Mac if sources are controlled via git
This commit is contained in:
Arnim Balzer
2024-04-16 09:52:45 +01:00
parent 411b218896
commit 805cc6385a
4 changed files with 7 additions and 0 deletions
@@ -10,6 +10,7 @@ bool SourceFileValid( const char* fn, uint64_t olderThan, const View& view, cons
struct stat buf;
if( stat( view.SourceSubstitution( fn ), &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 )
{
if(!view.ValidateSourceAge()) return true;
return (uint64_t)buf.st_mtime < olderThan;
}
return false;
+2
View File
@@ -124,6 +124,7 @@ public:
uint16_t GetPort() const { return m_worker.GetPort(); }
const char* SourceSubstitution( const char* srcFile ) const;
bool ValidateSourceAge() const { return m_validateSourceAge; }
void ShowSampleParents( uint64_t symAddr, bool withInlines ) { m_sampleParents.symAddr = symAddr; m_sampleParents.sel = 0; m_sampleParents.withInlines = withInlines; }
@@ -585,6 +586,7 @@ private:
std::vector<SourceRegex> m_sourceSubstitutions;
bool m_sourceRegexValid = true;
bool m_validateSourceAge = true;
RangeSlim m_setRangePopup;
bool m_setRangePopupOpen = false;
@@ -863,6 +863,8 @@ void View::DrawInfo()
m_sourceRegexValid = regexValid;
}
ImGui::Checkbox("Enforce source file modification time older than trace capture time", &m_validateSourceAge);
ImGui::TreePop();
}