Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit eb89f68

Browse files
authored
Merge pull request #6069 from dotnet-bot/from-tfs
Merge changes from TFS
2 parents 6c41702 + 6410ab9 commit eb89f68

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/jit/compiler.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6575,6 +6575,7 @@ void JitTimer::PrintCsvHeader()
65756575
// Ex: ngen install mscorlib won't print stats for "ngen" but for "mscorsvw"
65766576
FILE* fp = _wfopen(jitTimeLogCsv, W("w"));
65776577
fprintf(fp, "\"Method Name\",");
6578+
fprintf(fp, "\"Method Index\",");
65786579
fprintf(fp, "\"IL Bytes\",");
65796580
fprintf(fp, "\"Basic Blocks\",");
65806581
fprintf(fp, "\"Opt Level\",");
@@ -6590,6 +6591,8 @@ void JitTimer::PrintCsvHeader()
65906591
}
65916592
}
65926593

6594+
extern ICorJitHost* g_jitHost;
6595+
65936596
void JitTimer::PrintCsvMethodStats(Compiler* comp)
65946597
{
65956598
LPCWSTR jitTimeLogCsv = Compiler::JitTimeLogCsv();
@@ -6601,10 +6604,20 @@ void JitTimer::PrintCsvMethodStats(Compiler* comp)
66016604
// eeGetMethodFullName uses locks, so don't enter crit sec before this call.
66026605
const char* methName = comp->eeGetMethodFullName(comp->info.compMethodHnd);
66036606

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+
66046616
CritSecHolder csvLock(s_csvLock);
66056617

66066618
FILE* fp = _wfopen(jitTimeLogCsv, W("a"));
66076619
fprintf(fp, "\"%s\",", methName);
6620+
fprintf(fp, "%d,", index);
66086621
fprintf(fp, "%u,", comp->info.compILCodeSize);
66096622
fprintf(fp, "%u,", comp->fgBBcount);
66106623
fprintf(fp, "%u,", comp->opts.MinOpts());

0 commit comments

Comments
 (0)