@@ -6575,6 +6575,7 @@ void JitTimer::PrintCsvHeader()
6575
6575
// Ex: ngen install mscorlib won't print stats for "ngen" but for "mscorsvw"
6576
6576
FILE* fp = _wfopen (jitTimeLogCsv, W (" w" ));
6577
6577
fprintf (fp, " \" Method Name\" ," );
6578
+ fprintf (fp, " \" Method Index\" ," );
6578
6579
fprintf (fp, " \" IL Bytes\" ," );
6579
6580
fprintf (fp, " \" Basic Blocks\" ," );
6580
6581
fprintf (fp, " \" Opt Level\" ," );
@@ -6590,6 +6591,8 @@ void JitTimer::PrintCsvHeader()
6590
6591
}
6591
6592
}
6592
6593
6594
+ extern ICorJitHost* g_jitHost;
6595
+
6593
6596
void JitTimer::PrintCsvMethodStats (Compiler* comp)
6594
6597
{
6595
6598
LPCWSTR jitTimeLogCsv = Compiler::JitTimeLogCsv ();
@@ -6601,10 +6604,20 @@ void JitTimer::PrintCsvMethodStats(Compiler* comp)
6601
6604
// eeGetMethodFullName uses locks, so don't enter crit sec before this call.
6602
6605
const char * methName = comp->eeGetMethodFullName (comp->info .compMethodHnd );
6603
6606
6607
+ // Try and access the SPMI index to report in the data set.
6608
+ //
6609
+ // If the jit is not hosted under SPMI this will return the
6610
+ // default value of zero.
6611
+ //
6612
+ // Query the jit host directly here instead of going via the
6613
+ // config cache, since value will change for each method.
6614
+ int index = g_jitHost->getIntConfigValue (W (" SuperPMIMethodContextNumber" ), 0 );
6615
+
6604
6616
CritSecHolder csvLock (s_csvLock);
6605
6617
6606
6618
FILE* fp = _wfopen (jitTimeLogCsv, W (" a" ));
6607
6619
fprintf (fp, " \" %s\" ," , methName);
6620
+ fprintf (fp, " %d," , index);
6608
6621
fprintf (fp, " %u," , comp->info .compILCodeSize );
6609
6622
fprintf (fp, " %u," , comp->fgBBcount );
6610
6623
fprintf (fp, " %u," , comp->opts .MinOpts ());
0 commit comments