Merge pull request #5180 from alexrp/profiler-zero-freq
authorAlex Rønne Petersen <alex@alexrp.com>
Fri, 7 Jul 2017 18:48:40 +0000 (20:48 +0200)
committerGitHub <noreply@github.com>
Fri, 7 Jul 2017 18:48:40 +0000 (20:48 +0200)
[profiler] Don't enable sampling if frequency is zero.

mono/profiler/log-args.c

index 0f2e9a131661df0f242b710a3fd7afbe36d91bce..a7d71f3202b726ae8448692c8716578a1dfd5ca2 100644 (file)
@@ -104,8 +104,9 @@ parse_arg (const char *arg, ProfilerConfig *config)
                config->enable_mask |= PROFLOG_HEAPSHOT_ALIAS;
                set_hsmode (config, val);
        } else if (match_option (arg, "sample", &val)) {
-               config->enable_mask |= PROFLOG_PERF_SAMPLING_ALIAS;
                set_sample_freq (config, val);
+               if (config->sample_freq)
+                       config->enable_mask |= PROFLOG_PERF_SAMPLING_ALIAS;
        } else if (match_option (arg, "zip", NULL)) {
                config->use_zip = TRUE;
        } else if (match_option (arg, "output", &val)) {