-
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
Add New Test to Track Number of Jitted Methods #91235
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7b31090
New beginning for the Jitted Methods Counting Test.
ivdiazsa b565e74
EXPERIMENTAL CHANGE ONLY: Added a command to print the whole directory
ivdiazsa 2317a4b
experimental change only: Discovered the jobs have dependencies on
ivdiazsa caf11e8
EXPERIMENT-ONLY CHANGE: Added the 'ls -R' directly to the Helix Post
ivdiazsa fda5625
Merge branch 'main' into jitted-parts
ivdiazsa efd048d
Maybe it doesn't like me removing the innerloop...?
ivdiazsa d243aef
More experimenting... So we can't do just musl...
ivdiazsa 90b639e
Merge branch 'main' into jitted-parts
ivdiazsa 87212da
Changed the test's methodology to use the JitInfo API, instead of
ivdiazsa 7c3cca8
Added the `AlwaysUseCrossgen2` property to the HelloWorld test app.
ivdiazsa 85f3317
Now printing the Jitted Methods to compare with my local machine.
ivdiazsa 0893d48
REVIEW-READY: Reenabled all the pipelines to see if there are any
ivdiazsa 35bc35e
Changed the Jitted methods counter to consider the whole process,
ivdiazsa cf7996b
DEBUG-ONLY CHANGE: We're getting more Jitted methods on Arm64 for some
ivdiazsa bb026de
Merge branch 'main' into jitted-parts
ivdiazsa 1a33f0b
Enabled musl outerloop pipelines because we were observing different
ivdiazsa 88d59f2
Will you stop complaining now?
ivdiazsa ad3f2fd
READY: Reenabled the pipelines and disabled the test for R2R_CG2
ivdiazsa b99398d
Changed the jits-number limit.
ivdiazsa adbb0b2
Changed the test to not require an external app anymore, and fixed
ivdiazsa 1e81e8a
DEBUG-ONLY CHANGE: Printing some logging to try to figure out why
ivdiazsa ad7a855
...
ivdiazsa 376b205
...
ivdiazsa d9cb394
Due to how some machines are set up, it is actually possible for a
ivdiazsa 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
60 changes: 60 additions & 0 deletions
60
src/tests/readytorun/JittedMethodsCountingTest/JittedMethodsCountingTest.cs
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,60 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using Xunit; | ||
|
||
using InteropServices = System.Runtime.InteropServices; | ||
using JitInfo = System.Runtime.JitInfo; | ||
|
||
public class JittedMethodsCountingTest | ||
{ | ||
private const int MAX_JITTED_METHODS_ACCEPTED = 70; | ||
|
||
[Fact] | ||
public static int TestEntryPoint() | ||
{ | ||
// If DOTNET_ReadyToRun is disabled, then this test ought to be skipped. | ||
if (!IsReadyToRunEnvSet()) | ||
{ | ||
Console.WriteLine("\nThis test is only supported in ReadyToRun scenarios." | ||
+ " Skipping...\n"); | ||
return 100; | ||
} | ||
|
||
if (IsRunCrossgen2Set() && IsRunningOnARM64()) | ||
{ | ||
Console.WriteLine("\nThis test is currently unsupported on ARM64 when" | ||
+ " RunCrossGen2 is enabled. Skipping...\n"); | ||
return 100; | ||
} | ||
|
||
Console.WriteLine("\nHello World from Jitted Methods Counting Test!"); | ||
|
||
long jits = JitInfo.GetCompiledMethodCount(false); | ||
Console.WriteLine("Number of Jitted Methods in App: {0}\n", jits); | ||
|
||
return (jits >= 0 && jits <= MAX_JITTED_METHODS_ACCEPTED) ? 100 : 101; | ||
} | ||
|
||
private static bool IsReadyToRunEnvSet() | ||
{ | ||
string? dotnetR2R = Environment.GetEnvironmentVariable("DOTNET_ReadyToRun"); | ||
return (string.IsNullOrEmpty(dotnetR2R) || dotnetR2R == "1"); | ||
} | ||
|
||
private static bool IsRunCrossgen2Set() | ||
{ | ||
string? runCrossgen2 = Environment.GetEnvironmentVariable("RunCrossGen2"); | ||
return (runCrossgen2 == "1"); | ||
} | ||
|
||
private static bool IsRunningOnARM64() | ||
{ | ||
InteropServices.Architecture thisMachineArch = InteropServices | ||
.RuntimeInformation | ||
.OSArchitecture; | ||
|
||
return (thisMachineArch == InteropServices.Architecture.Arm64); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/tests/readytorun/JittedMethodsCountingTest/JittedMethodsCountingTest.csproj
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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<JitOptimizationSensitive>true</JitOptimizationSensitive> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="JittedMethodsCountingTest.cs" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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.
This WIP code needs to be reverted!
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.
Oh I forgot! Good catch, Jan. I will submit a PR fixing that right away.