Skip to content
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

Update GCPerfSim to enable targeting .NET > 5 #2388

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/benchmarks/gc/src/exec/GCPerfSim/GCPerfSim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ private Item(uint size, bool isPinned, bool isWeakLong, bool isPoh)

if (isPoh)
{
#if NET5_0
#if NET5_0_OR_GREATER
#if STATISTICS
statistics.pohAllocatedBytes += remainingSize;
#endif
Expand Down Expand Up @@ -517,7 +517,7 @@ public SimpleRefPayLoad(uint size, bool isPinned, bool isPoh)
uint remainingSize = size - SimpleRefPayLoadSize;
if (isPoh)
{
#if NET5_0
#if NET5_0_OR_GREATER
#if STATISTICS
statistics.pohAllocatedBytes += remainingSize;
#endif
Expand Down Expand Up @@ -759,7 +759,7 @@ public override string ToString()
{
string result = $"{sizeRange}; surv every {survInterval}; pin every {pinInterval}; weight {weight}";

#if NET5_0
#if NET5_0_OR_GREATER
result += $"; isPoh {isPoh}";
#endif

Expand Down Expand Up @@ -1368,7 +1368,7 @@ private static Args ParseFromFile(string fileName)
private const uint DEFAULT_POH_ALLOC_LOW = 100;
private const uint DEFAULT_POH_ALLOC_HIGH = 200 * 1024;

#if NET5_0
#if NET5_0_OR_GREATER
private const uint DEFAULT_POH_PINNING_INTERVAL = 0;
private const uint DEFAULT_POH_FINALIZABLE_INTERVAL = 0;
private const uint DEFAULT_POH_SURV_INTERVAL = 0;
Expand Down Expand Up @@ -1400,7 +1400,7 @@ private static Args ParseFromCommandLine(string[] args)
uint pohAllocLow = DEFAULT_POH_ALLOC_LOW;
uint pohAllocHigh = DEFAULT_POH_ALLOC_HIGH;

#if NET5_0
#if NET5_0_OR_GREATER
uint pohFinalizableInterval = DEFAULT_POH_FINALIZABLE_INTERVAL;
uint pohSurvInterval = DEFAULT_POH_SURV_INTERVAL;
#endif
Expand All @@ -1420,6 +1420,7 @@ private static Args ParseFromCommandLine(string[] args)
finishWithFullCollect = true;
break;
case "-endException":
case "-ee":
endException = true;
break;
case "-testKind":
Expand All @@ -1436,7 +1437,7 @@ private static Args ParseFromCommandLine(string[] args)
break;
case "-pohAllocRatio":
case "-pohar":
#if NET5_0
#if NET5_0_OR_GREATER
pohAllocRatioArg = ParseUInt32(args[++i]);
#else
Console.WriteLine("The flag {0} is only supported on .NET Core 5+. Skipping in this run.",
Expand Down Expand Up @@ -1466,7 +1467,7 @@ private static Args ParseFromCommandLine(string[] args)
break;
case "-pohSizeRange":
case "-pohsr":
#if NET5_0
#if NET5_0_OR_GREATER
ParseRange(args[++i], out pohAllocLow, out pohAllocHigh);
#else
Console.WriteLine("The flag {0} is only supported on .NET Core 5+. Skipping in this run.",
Expand All @@ -1483,7 +1484,7 @@ private static Args ParseFromCommandLine(string[] args)
break;
case "-pohSurvInterval":
case "-pohsi":
#if NET5_0
#if NET5_0_OR_GREATER
pohSurvInterval = ParseUInt32(args[++i]);
#else
Console.WriteLine("The flag {0} is only supported on .NET Core 5+. Skipping in this run.",
Expand All @@ -1509,7 +1510,7 @@ private static Args ParseFromCommandLine(string[] args)

case "-pohFinalizableInterval":
case "-pohfi":
#if NET5_0
#if NET5_0_OR_GREATER
pohFinalizableInterval = ParseUInt32(args[++i]);
#else
Console.WriteLine("The flag {0} is only supported on .NET Core 5+. Skipping in this run.",
Expand All @@ -1533,7 +1534,7 @@ private static Args ParseFromCommandLine(string[] args)
}

if (totalLiveBytes == 0 && (sohSurvInterval != 0 || lohSurvInterval != 0
#if NET5_0
#if NET5_0_OR_GREATER
|| pohSurvInterval != 0
#endif
))
Expand Down Expand Up @@ -1593,7 +1594,7 @@ private static Args ParseFromCommandLine(string[] args)
bucketList.Add(lohBucket);
}

#if NET5_0
#if NET5_0_OR_GREATER
if (pohWeight > 0)
{
BucketSpec pohBucket = new BucketSpec(
Expand Down