Enable FEATURE_JIT_METHOD_PERF always (even when FEATURE_CORECLR is on). (#7028)
authorPeter Kukol <pkukol@users.noreply.github.com>
Tue, 6 Sep 2016 16:21:13 +0000 (10:21 -0600)
committerJan Kotas <jkotas@microsoft.com>
Tue, 6 Sep 2016 16:21:13 +0000 (09:21 -0700)
src/inc/switches.h
src/jit/compiler.cpp
src/jit/compiler.h

index 3b94631..f52f24b 100644 (file)
 // hardware instructions (rdtsc), for accessing high-resolution hardware timers is enabled. This is disabled
 // in Silverlight (just to avoid thinking about whether the extra code space is worthwhile).
 #define FEATURE_JIT_TIMER
+#endif // FEATURE_CORECLR
 
 // This feature in RyuJIT supersedes the FEATURE_JIT_TIMER. In addition to supporting the time log file, this
 // feature also supports using COMPlus_JitTimeLogCsv=a.csv, which will dump method-level and phase-level timing
 // statistics. Also see comments on FEATURE_JIT_TIMER.
 #define FEATURE_JIT_METHOD_PERF
-#endif // FEATURE_CORECLR
 
 
 #ifndef FEATURE_USE_ASM_GC_WRITE_BARRIERS
index f127b70..afbecdf 100644 (file)
@@ -7202,7 +7202,8 @@ void JitTimer::PrintCsvHeader()
 
     CritSecHolder csvLock(s_csvLock);
 
-    if (_waccess(jitTimeLogCsv, 0) == -1)
+    FILE* fp = _wfopen(jitTimeLogCsv, W("r"));
+    if (fp == nullptr)
     {
         // File doesn't exist, so create it and write the header
 
@@ -7225,8 +7226,8 @@ void JitTimer::PrintCsvHeader()
 
         fprintf(fp, "\"Total Cycles\",");
         fprintf(fp, "\"CPS\"\n");
-        fclose(fp);
     }
+    fclose(fp);
 }
 
 extern ICorJitHost* g_jitHost;
index 455b78f..05047c5 100644 (file)
@@ -996,7 +996,7 @@ public:
     // This is the unique CompTimeSummaryInfo object for this instance of the runtime.
     static CompTimeSummaryInfo s_compTimeSummary;
 
-    CompTimeSummaryInfo() : m_total(0), m_maximum(0), m_numMethods(0), m_filtered(0), m_numFilteredMethods(0)
+    CompTimeSummaryInfo() : m_numMethods(0), m_total(0), m_maximum(0), m_numFilteredMethods(0), m_filtered(0)
     {
     }