diff options
author | Alex Rønne Petersen <alexrp@xamarin.com> | 2017-06-28 15:07:39 +0300 |
---|---|---|
committer | Alex Rønne Petersen <alexrp@xamarin.com> | 2017-06-28 15:07:39 +0300 |
commit | 3298fe7f2102e18df8ae52a6f0ca8df9d9003571 (patch) | |
tree | b447d276e84107e2ff1452b9cbdcba0cfcc951f0 /acceptance-tests | |
parent | 80165d21175e05d502b968701b41a0d66608cc99 (diff) |
[acceptance-tests] Don't pass a zero sampling/heapshot frequency in the profiler stress runner.
Also change the code to make it more likely that we actually do some runs
without sampling or heapshot enabled.
Diffstat (limited to 'acceptance-tests')
-rw-r--r-- | acceptance-tests/profiler-stress/runner.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/acceptance-tests/profiler-stress/runner.cs b/acceptance-tests/profiler-stress/runner.cs index 51c9d91f5e5..302e43e6392 100644 --- a/acceptance-tests/profiler-stress/runner.cs +++ b/acceptance-tests/profiler-stress/runner.cs @@ -95,16 +95,22 @@ namespace Mono.Profiling.Tests.Stress { for (var i = 0; i < benchmarks.Length; i++) { var bench = benchmarks [i]; - var sampleFreq = rand.Next (0, 1001); + var sampleFreq = rand.Next (-1000, 1001); var sampleMode = rand.Next (0, 2) == 1 ? "real" : "process"; var maxSamples = rand.Next (0, cpus * 2000 + 1); - var heapShotFreq = rand.Next (0, 11); + var heapShotFreq = rand.Next (-10, 11); var maxFrames = rand.Next (0, 33); var options = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1) .Select (x => (x.Value ? string.Empty : "no") + x.Key) .ToArray (); - var profOptions = $"sample={sampleFreq},sampling-{sampleMode},maxsamples={maxSamples},heapshot={heapShotFreq}gc,maxframes={maxFrames},{string.Join (",", options)},output=/dev/null"; + var profOptions = $"maxframes={maxFrames},{string.Join (",", options)},output=/dev/null"; + + if (sampleFreq > 0) + profOptions += $",sample={sampleFreq},sampling-{sampleMode},maxsamples={maxSamples}"; + + if (heapShotFreq > 0) + profOptions += $",heapshot={heapShotFreq}gc"; var info = new ProcessStartInfo { UseShellExecute = false, |