[acceptance-tests] Update the profiler-stress test runner for the profiler's new...
authorAlex Rønne Petersen <alexrp@xamarin.com>
Tue, 20 Jun 2017 04:22:28 +0000 (06:22 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Tue, 20 Jun 2017 04:22:28 +0000 (06:22 +0200)
This allows us to test a lot more combinations than previously.

acceptance-tests/profiler-stress/runner.cs

index 5ef4ab02a2eb198eeb669e3a1fed781af3376828..51c9d91f5e5f0ddbc42c89a85680c8dbe5f751a7 100644 (file)
@@ -44,6 +44,26 @@ namespace Mono.Profiling.Tests.Stress {
 
        static class Program {
 
+               static readonly string[] _options = new [] {
+                       "domain",
+                       "assembly",
+                       "module",
+                       "class",
+                       "jit",
+                       "exception",
+                       "gcalloc",
+                       "gc",
+                       "thread",
+                       // "calls", // Way too heavy.
+                       "monitor",
+                       "gcmove",
+                       "gcroot",
+                       "context",
+                       "finalization",
+                       "counter",
+                       "gchandle",
+               };
+
                static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
 
                static string FilterInvalidXmlChars (string text) {
@@ -80,9 +100,11 @@ namespace Mono.Profiling.Tests.Stress {
                                var maxSamples = rand.Next (0, cpus * 2000 + 1);
                                var heapShotFreq = rand.Next (0, 11);
                                var maxFrames = rand.Next (0, 33);
-                               var allocMode = rand.Next (0, 2) == 1 ? "alloc" : "noalloc";
+                               var options = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
+                                                     .Select (x => (x.Value ? string.Empty : "no") + x.Key)
+                                                     .ToArray ();
 
-                               var profOptions = $"sample=cycles/{sampleFreq},sampling-{sampleMode},maxsamples={maxSamples},heapshot={heapShotFreq}gc,maxframes={maxFrames},{allocMode},output=/dev/null";
+                               var profOptions = $"sample={sampleFreq},sampling-{sampleMode},maxsamples={maxSamples},heapshot={heapShotFreq}gc,maxframes={maxFrames},{string.Join (",", options)},output=/dev/null";
 
                                var info = new ProcessStartInfo {
                                        UseShellExecute = false,