From e70de80ef88f15cdc694ed773006854c1ed0b681 Mon Sep 17 00:00:00 2001 From: Peter Kukol Date: Tue, 6 Sep 2016 10:21:13 -0600 Subject: [PATCH] Enable FEATURE_JIT_METHOD_PERF always (even when FEATURE_CORECLR is on). (#7028) --- src/inc/switches.h | 2 +- src/jit/compiler.cpp | 5 +++-- src/jit/compiler.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/inc/switches.h b/src/inc/switches.h index 3b94631..f52f24b 100644 --- a/src/inc/switches.h +++ b/src/inc/switches.h @@ -203,12 +203,12 @@ // 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 diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp index f127b70..afbecdf 100644 --- a/src/jit/compiler.cpp +++ b/src/jit/compiler.cpp @@ -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; diff --git a/src/jit/compiler.h b/src/jit/compiler.h index 455b78f..05047c5 100644 --- a/src/jit/compiler.h +++ b/src/jit/compiler.h @@ -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) { } -- 2.7.4