-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: Enhance metrics reported by superpmi diffs #74584
Changes from 16 commits
706953d
ba7bd0c
4ad92a1
13a4ab7
75f71a0
631d489
c8d4b8e
5d79fb9
70c4abd
e7087df
286a1f5
654a5d9
365a0d4
38a85fb
366523a
e58e404
17778ad
fa45a99
a710c45
e0cc967
3fe712a
d180d77
1a23870
6910d3c
25285d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,4 +116,6 @@ static inline void __debugbreak() | |
} | ||
#endif | ||
|
||
#include <minipal/utils.h> | ||
|
||
#endif // STANDARDPCH_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,7 +298,7 @@ extern "C" DLLEXPORT NOINLINE void Instrumentor_GetInsCount(UINT64* result) | |
} | ||
} | ||
|
||
JitInstance::Result JitInstance::CompileMethod(MethodContext* MethodToCompile, int mcIndex, bool collectThroughput, MetricsSummary* metrics) | ||
JitInstance::Result JitInstance::CompileMethod(MethodContext* MethodToCompile, int mcIndex, bool collectThroughput, MetricsSummary* metrics, bool* isMinOpts) | ||
{ | ||
struct Param : FilterSuperPMIExceptionsParam_CaptureException | ||
{ | ||
|
@@ -309,13 +309,17 @@ JitInstance::Result JitInstance::CompileMethod(MethodContext* MethodToCompile, i | |
int mcIndex; | ||
bool collectThroughput; | ||
MetricsSummary* metrics; | ||
bool* isMinOpts; | ||
} param; | ||
param.pThis = this; | ||
param.result = RESULT_SUCCESS; // assume success | ||
param.flags = 0; | ||
param.mcIndex = mcIndex; | ||
param.collectThroughput = collectThroughput; | ||
param.metrics = metrics; | ||
param.isMinOpts = isMinOpts; | ||
|
||
*isMinOpts = false; | ||
|
||
// store to instance field our raw values, so we can figure things out a bit later... | ||
mc = MethodToCompile; | ||
|
@@ -335,6 +339,14 @@ JitInstance::Result JitInstance::CompileMethod(MethodContext* MethodToCompile, i | |
CORINFO_OS os = CORINFO_WINNT; | ||
|
||
pParam->pThis->mc->repCompileMethod(&pParam->info, &pParam->flags, &os); | ||
CORJIT_FLAGS jitFlags; | ||
pParam->pThis->mc->repGetJitFlags(&jitFlags, sizeof(jitFlags)); | ||
|
||
*pParam->isMinOpts = | ||
jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE) || | ||
jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MIN_OPT) || | ||
jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_TIER0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think Tier0 code is same as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Today they are practically the same, I think. They both lead to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Also note that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, I was checking yesterday and comparing it with "debuggable code" which is different. I was thinking that "debuggable code" is min-opts. |
||
|
||
if (pParam->collectThroughput) | ||
{ | ||
pParam->pThis->lt.Start(); | ||
|
@@ -347,6 +359,17 @@ JitInstance::Result JitInstance::CompileMethod(MethodContext* MethodToCompile, i | |
pParam->pThis->lt.Stop(); | ||
pParam->pThis->times[0] = pParam->pThis->lt.GetCycles(); | ||
} | ||
|
||
CorInfoMethodRuntimeFlags flags = pParam->pThis->mc->cr->repSetMethodAttribs(pParam->info.ftn); | ||
if ((flags & CORINFO_FLG_SWITCHED_TO_MIN_OPT) != 0) | ||
{ | ||
*pParam->isMinOpts = true; | ||
} | ||
else if ((flags & CORINFO_FLG_SWITCHED_TO_OPTIMIZED) != 0) | ||
{ | ||
*pParam->isMinOpts = false; | ||
} | ||
|
||
if (jitResult == CORJIT_SKIPPED) | ||
{ | ||
SPMI_TARGET_ARCHITECTURE targetArch = GetSpmiTargetArchitecture(); | ||
|
@@ -436,7 +459,6 @@ JitInstance::Result JitInstance::CompileMethod(MethodContext* MethodToCompile, i | |
{ | ||
metrics->SuccessfulCompiles++; | ||
metrics->NumExecutedInstructions += static_cast<long long>(insCountAfter - insCountBefore); | ||
|
||
} | ||
else | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remind me why this section is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sections are printed by superpmi.py now.