Skip to content

Commit d572b0c

Browse files
shimingsgCopilot
andauthored
Add Configuration for analyzing dump and format console log for RF (#4931)
* resolve issues in PR#4848 * Use short name RF for ReliabilityFramework and structure the console logs * fix addressed issues in PR#4803 * Use short name for Relibility Framework * add RF Analysis configuration * Update src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/Configurations/RFCreateSuites.Configuration.cs correct the typo Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 9a12e48 commit d572b0c

File tree

12 files changed

+491
-472
lines changed

12 files changed

+491
-472
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DumpFolder: Q:\ReliabilityFramework\Dumps
2+
AnalyzeOutputFolder: Q:\ReliabilityFramework\AnalyzeDump_Output
3+
StackFrameKeyWords:
4+
- "::gc_heap::"
5+
- "::GCHeap::"
6+
DebuggerPath: windbgx
7+
Core_Root: Q:\Core_Root
8+
WSLInstanceLocation: \\wsl.localhost\Debian

src/benchmarks/gc/GC.Infrastructure/Configurations/ReliabilityFrameworkTestCreateSuite.yaml renamed to src/benchmarks/gc/GC.Infrastructure/Configurations/ReliabilityFramework/ReliabilityFramework_CreateTestSuite.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
OutputFolder: Q:\output-data_sync_checkin
1+
OutputFolder: Q:\ReliabilityFramework\TestSuites
22

33
EnableStressMode: false
44

5-
CoreRoot: Q:\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root
5+
Core_Root: Q:\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root
66
ReliabilityFrameworkDll: Q:\runtime\artifacts\tests\coreclr\windows.x64.Release\GC\Stress\Framework\ReliabilityFramework\ReliabilityFramework.dll
77
GCPerfSimDll: Q:\performance\artifacts\bin\GCPerfSim\Release\net7.0\GCPerfSim.dll
88
TestFolder: Q:\runtime\artifacts\tests\coreclr\windows.x64.Release\GC\Stress\Framework\ReliabilityFramework\Tests
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using YamlDotNet.Serialization;
2+
3+
namespace GC.Infrastructure.Core.Configurations
4+
{
5+
public sealed class RFAnalyzeConfiguration
6+
{
7+
public required string DebuggerPath { get; set; }
8+
public required List<string> StackFrameKeyWords { get; set; }
9+
public required string Core_Root { get; set; }
10+
public required string WSLInstanceLocation { get; set; }
11+
public required string DumpFolder { get; set; }
12+
public required string AnalyzeOutputFolder { get; set; }
13+
}
14+
15+
public static class RFAnalyzeConfigurationParser
16+
{
17+
private static readonly IDeserializer _deserializer =
18+
new DeserializerBuilder().IgnoreUnmatchedProperties().Build();
19+
20+
public static RFAnalyzeConfiguration Parse(string path)
21+
{
22+
// Preconditions.
23+
ConfigurationChecker.VerifyFile(path, nameof(RFAnalyzeConfigurationParser));
24+
25+
string serializedConfiguration = File.ReadAllText(path);
26+
RFAnalyzeConfiguration? configuration = null;
27+
28+
// This try catch is here because the exception from the YamlDotNet isn't helpful and must be imbued with more details.
29+
try
30+
{
31+
configuration = _deserializer.Deserialize<RFAnalyzeConfiguration>(serializedConfiguration);
32+
}
33+
catch (Exception ex)
34+
{
35+
throw new ArgumentException($"{nameof(RFAnalyzeConfiguration)}: Unable to parse the yaml file because of an error in the syntax. Exception: {ex.Message} \n Call Stack: {ex.StackTrace}");
36+
}
37+
38+
if (String.IsNullOrEmpty(configuration.AnalyzeOutputFolder))
39+
{
40+
throw new ArgumentException($"{nameof(RFAnalyzeConfiguration)}: Provide a analyze output folder.");
41+
}
42+
43+
if (!Path.Exists(configuration.DumpFolder))
44+
{
45+
throw new ArgumentException($"{nameof(RFAnalyzeConfiguration)}: Dump folder doesn't exist.");
46+
}
47+
48+
// Check Core_Root folder
49+
if (!Path.Exists(configuration.Core_Root))
50+
{
51+
throw new ArgumentException($"{nameof(RFAnalyzeConfiguration)}: Core_Root doesn't exist.");
52+
}
53+
bool hasCoreRun = Directory.GetFiles(configuration.Core_Root)
54+
.Any(filePath => Path.GetFileNameWithoutExtension(filePath) == "corerun");
55+
if (!hasCoreRun)
56+
{
57+
throw new ArgumentException($"{nameof(RFAnalyzeConfiguration)}: Provide a valid Core_Root.");
58+
}
59+
60+
return configuration;
61+
}
62+
}
63+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
using YamlDotNet.Serialization;
2+
3+
namespace GC.Infrastructure.Core.Configurations
4+
{
5+
public sealed class RFCreateSuitesConfiguration
6+
{
7+
/// <summary>
8+
/// Gets or sets the output path
9+
/// </summary>
10+
public string OutputFolder { get; set; }
11+
12+
/// <summary>
13+
/// Gets or sets the Core_Root path
14+
/// </summary>
15+
public string Core_Root { get; set; }
16+
17+
/// <summary>
18+
/// Gets or sets the Reliability Framework DLL path
19+
/// </summary>
20+
public string ReliabilityFrameworkDll { get; set; }
21+
22+
/// <summary>
23+
/// Gets or sets a value indicating whether the test is running in stress mode.
24+
/// </summary>
25+
public bool EnableStressMode { get; set; }
26+
27+
/// <summary>
28+
/// Gets or sets the GCPerfSim DLL path.
29+
/// </summary>
30+
public string GCPerfSimDll { get; set; }
31+
32+
/// <summary>
33+
/// Gets or sets the path to the test folder.
34+
/// </summary>
35+
public string TestFolder { get; set; }
36+
}
37+
38+
public static class RFCreateSuitesConfigurationParser
39+
{
40+
private static readonly IDeserializer _deserializer =
41+
new DeserializerBuilder().IgnoreUnmatchedProperties().Build();
42+
43+
public static RFCreateSuitesConfiguration Parse(string path)
44+
{
45+
// Preconditions.
46+
ConfigurationChecker.VerifyFile(path, nameof(RFCreateSuitesConfigurationParser));
47+
48+
string serializedConfiguration = File.ReadAllText(path);
49+
RFCreateSuitesConfiguration? configuration = null;
50+
51+
// This try catch is here because the exception from the YamlDotNet isn't helpful and must be imbued with more details.
52+
try
53+
{
54+
configuration = _deserializer.Deserialize<RFCreateSuitesConfiguration>(serializedConfiguration);
55+
}
56+
57+
catch (Exception ex)
58+
{
59+
throw new ArgumentException($"{nameof(RFCreateSuitesConfiguration)}: Unable to parse the yaml file because of an error in the syntax. Exception: {ex.Message} \n Call Stack: {ex.StackTrace}");
60+
}
61+
62+
if (string.IsNullOrEmpty(configuration.OutputFolder))
63+
{
64+
throw new ArgumentException($"{nameof(RFCreateSuitesConfiguration)}: Please specify output folder");
65+
}
66+
67+
if (string.IsNullOrEmpty(configuration.ReliabilityFrameworkDll) )
68+
{
69+
throw new ArgumentException($"{nameof(RFCreateSuitesConfiguration)}: Please specify ReliabilityFrameworkDll");
70+
}
71+
72+
if (!Path.Exists(configuration.Core_Root))
73+
{
74+
throw new ArgumentException($"{nameof(RFCreateSuitesConfiguration)}: Given CoreRoot path is not valid");
75+
}
76+
77+
if (string.IsNullOrEmpty(configuration.GCPerfSimDll))
78+
{
79+
throw new ArgumentException($"{nameof(RFCreateSuitesConfiguration)}: Please specify GCPerfSimDll");
80+
}
81+
82+
if (!Path.Exists(configuration.TestFolder))
83+
{
84+
throw new ArgumentException($"{nameof(RFCreateSuitesConfiguration)}: Given TestFolder path is not valid");
85+
}
86+
87+
return configuration;
88+
}
89+
}
90+
}

src/benchmarks/gc/GC.Infrastructure/GC.Infrastructure.Core/Configurations/ReliabilityFrameworkTest.CreateTestSuite.cs

Lines changed: 0 additions & 183 deletions
This file was deleted.

0 commit comments

Comments
 (0)