Merge pull request #774 from Chekov2k/source_validation

Allow source file modification time to be newer then trace capture time
This commit is contained in:
Bartosz Taudul 2024-04-16 11:44:27 +02:00 committed by GitHub
commit 44be569f4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 0 deletions

View File

@ -3736,6 +3736,8 @@ Let's say we have an Unix-based operating system with program sources in \texttt
\end{itemize}
\end{bclogo}
By default, all source file modification times need to be older than the cature time of the trace. This can be disabled using the \emph{Enforce source file modification time older than trace capture time} check box, i.e. when the source files are under source control and the file modification time is not relevant.
In this window, you can view the information about the machine on which the profiled application was running. This includes the operating system, used compiler, CPU name, total available RAM, etc. In addition, if application information was provided (see section~\ref{appinfo}), it will also be displayed here.
If an application should crash during profiling (section~\ref{crashhandling}), the profiler will display the crash information in this window. It provides you information about the thread that has crashed, the crash reason, and the crash call stack (section~\ref{callstackwindow}).

View File

@ -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;

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;

View File

@ -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();
}