-
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: Add a unified mechanism to track metadata/metrics about the compilation #98653
Merged
Merged
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b8a6343
JIT: Add a unified mechanism to track metadata/metrics about the comp…
jakobbotsch 6e3cf3e
Clean ups
jakobbotsch 4f7f361
Nit
jakobbotsch ad02f9f
Further fixing
jakobbotsch 4018a4c
Fixes
jakobbotsch a06d6ed
Allow access in release as well
jakobbotsch 867374d
Support writing CSV field names with quotes in them
jakobbotsch 3bf7adc
Fix gcc build
jakobbotsch e821bbd
Clean up
jakobbotsch 1e2a1d9
Add some more metrics; display them in JITDUMP; really report them at…
jakobbotsch d96f2e5
Reorder a bit
jakobbotsch 469c3de
Nit
jakobbotsch 601cf6b
Update JIT-EE version GUID again
jakobbotsch 186da27
Support fast PerfScore diffs in superpmi.py
jakobbotsch 1a075c3
Fix reporting inlinee full name
jakobbotsch a637694
Fix a bug in PAL version of _vsnprintf_s
jakobbotsch 4624ddc
Clean up, add function header comment
jakobbotsch 7dd107c
Fix
jakobbotsch eca3dd9
Print PerfScore geomeans
jakobbotsch f890303
Add to report
jakobbotsch ee5ad8b
Clean up
jakobbotsch a839f53
Move overall perfscore change to details
jakobbotsch df8f962
Merge branch 'main' of github.com:dotnet/runtime into jit-metrics
jakobbotsch 845bb9c
Address feedback
jakobbotsch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#include "jitpch.h" | ||
#include "jitmetadata.h" | ||
|
||
#ifdef DEBUG | ||
|
||
const char* JitMetadata::getName(JitMetadataName name) | ||
{ | ||
switch (name) | ||
{ | ||
#define JITMETADATA(name, type, flags) \ | ||
case JitMetadataName::name: \ | ||
return #name; | ||
#include "jitmetadatalist.h" | ||
|
||
default: | ||
unreached(); | ||
} | ||
} | ||
|
||
void JitMetadata::report(Compiler* comp, JitMetadataName name, const void* data) | ||
{ | ||
comp->info.compCompHnd->reportMetadata(getName(name), data); | ||
} | ||
|
||
template <typename T> | ||
static void reportValue(Compiler* comp, const char* key, T value) | ||
{ | ||
comp->info.compCompHnd->reportMetadata(key, &value); | ||
} | ||
|
||
void JitMetrics::report(Compiler* comp) | ||
{ | ||
#define JITMETADATAINFO(name, type, flags) | ||
#define JITMETADATAMETRIC(name, type, flags) reportValue(comp, #name, name); | ||
#include "jitmetadatalist.h" | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#pragma once | ||
|
||
class Compiler; | ||
|
||
enum class JitMetadataName | ||
{ | ||
#define JITMETADATA(name, type, flags) name, | ||
#include "jitmetadatalist.h" | ||
}; | ||
|
||
class JitMetadata | ||
{ | ||
public: | ||
static const char* getName(JitMetadataName name); | ||
static void report(Compiler* comp, JitMetadataName name, const void* data); | ||
}; | ||
|
||
class JitMetrics | ||
{ | ||
public: | ||
#define JITMETADATAINFO(name, type, flags) | ||
#define JITMETADATAMETRIC(name, type, flags) type name = 0; | ||
#include "jitmetadatalist.h" | ||
|
||
void report(Compiler* comp); | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should the
report
functions do nothing ifRunningSuperPmiReplay()
is false? (I guess the VM does nothing anyway)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.
Yeah I figured that we should just let it be up to the EE. If the EE wants to do something with the information then that's up to them. (Also, we don't check for SPMI in release JITs)