// Ex: ngen install mscorlib won't print stats for "ngen" but for "mscorsvw"
FILE* fp = _wfopen(jitTimeLogCsv, W("w"));
fprintf(fp, "\"Method Name\",");
+ fprintf(fp, "\"Method Index\",");
fprintf(fp, "\"IL Bytes\",");
fprintf(fp, "\"Basic Blocks\",");
fprintf(fp, "\"Opt Level\",");
}
}
+extern ICorJitHost* g_jitHost;
+
void JitTimer::PrintCsvMethodStats(Compiler* comp)
{
LPCWSTR jitTimeLogCsv = Compiler::JitTimeLogCsv();
// eeGetMethodFullName uses locks, so don't enter crit sec before this call.
const char* methName = comp->eeGetMethodFullName(comp->info.compMethodHnd);
+ // Try and access the SPMI index to report in the data set.
+ //
+ // If the jit is not hosted under SPMI this will return the
+ // default value of zero.
+ //
+ // Query the jit host directly here instead of going via the
+ // config cache, since value will change for each method.
+ int index = g_jitHost->getIntConfigValue(W("SuperPMIMethodContextNumber"), 0);
+
CritSecHolder csvLock(s_csvLock);
FILE* fp = _wfopen(jitTimeLogCsv, W("a"));
fprintf(fp, "\"%s\",", methName);
+ fprintf(fp, "%d,", index);
fprintf(fp, "%u,", comp->info.compILCodeSize);
fprintf(fp, "%u,", comp->fgBBcount);
fprintf(fp, "%u,", comp->opts.MinOpts());