Skip to content

Commit

Permalink
Fixed an ETL timing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Malcolm-Stewart committed Sep 28, 2021
1 parent 3832d8c commit 69c493e
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 6 deletions.
Binary file modified SQLCheck/.vs/SQLCheck/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified SQLCheck/.vs/SQLCheck/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
Binary file modified SQL_Network_Analyzer/.vs/SQLNetworkAnalyzer/v15/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 0 additions & 3 deletions SQL_Network_Analyzer/SQLNA/ETLFileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,11 @@ public ETLFileReader(string FilePath)
m_handle = TraceEventInterop.OpenTraceFile(ref m_logFile);

m_sessionStartTime = DateTime.FromFileTime(m_logFile.LogfileHeader.StartTime);
m_sessionEndTime = DateTime.FromFileTime(m_logFile.LogfileHeader.EndTime);
Program.logDiagnostic("There were " + m_logFile.EventsLost + " events lost.");
m_QPCFreq = m_logFile.LogfileHeader.PerfFreq;

if (m_QPCFreq == 0) m_QPCFreq = Stopwatch.Frequency;

Debug.Assert(m_sessionStartTime.Ticks != 0 && m_sessionEndTime.Ticks != 0 && m_sessionStartTime < m_sessionEndTime);

// We ask for raw timestamps, but the log file may have used system time as its raw timestamp.
// SystemTime is like a QPC time that happens 10M times a second (100ns).
// ReservedFlags is actually the ClockType 0 = Raw, 1 = QPC, 2 = SystemTimne 3 = CpuTick (we don't support)
Expand Down
5 changes: 4 additions & 1 deletion SQL_Network_Analyzer/SQLNA/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ public static long GetInitialTick(string filePath)
if (filePath.ToLower().EndsWith(".etl")) // ETL files have no magic number. Must be done by file name.
{
er = new ETLFileReader(filePath);
initialTick = er.GetStartTime().Ticks;
// initialTick = er.GetStartTime().Ticks;
er.Init();
Frame frame = er.Read();
if (frame != null) initialTick = frame.ticks; // extract tick information
if (Program.filterFormat == "A") Program.filterFormat = "N"; // format for "AUTO" format mode based on file type
}
else
Expand Down
4 changes: 2 additions & 2 deletions SQL_Network_Analyzer/SQLNA/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.1862.0")]
[assembly: AssemblyFileVersion("1.5.1862.0")]
[assembly: AssemblyVersion("1.5.1864.0")]
[assembly: AssemblyFileVersion("1.5.1864.0")]

0 comments on commit 69c493e

Please sign in to comment.