[profiler] Drop support for the old-style sample option.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Wed, 12 Jul 2017 14:06:11 +0000 (16:06 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Fri, 14 Jul 2017 10:59:27 +0000 (12:59 +0200)
mono/profiler/log-args.c

index c4d0c08f98c2006b362ef9b49ca044a259c91e90..a18572cc08d3af62e507c42ac63ac2730f2adb19 100644 (file)
@@ -248,46 +248,22 @@ set_hsmode (ProfilerConfig *config, const char* val)
                usage ();
 }
 
-/*
-Sampling frequency allows for one undocumented, hidden and ignored argument. The sampling kind.
-Back in the day when this was done using perf, we could specify one of: cycles,instr,cacherefs,cachemiss,branches,branchmiss
-With us moving ot userland sampling, those options are now meaningless.
-*/
 static void
 set_sample_freq (ProfilerConfig *config, const char *val)
 {
        if (!val)
                return;
 
-       const char *p = val;
-
-       // Is it only the frequency (new option style)?
-       if (isdigit (*p))
-               goto parse;
-
-       // Skip the sample type for backwards compatibility.
-       while (isalpha (*p))
-               p++;
-
-       // Skip the forward slash only if we got a sample type.
-       if (p != val && *p == '/') {
-               p++;
-
-               char *end;
-
-       parse:
-               config->sample_freq = strtoul (p, &end, 10);
+       char *end;
 
-               if (p == end) {
-                       usage ();
-                       return; 
-               }
+       int freq = strtoul (val, &end, 10);
 
-               p = end;
+       if (val == end) {
+               usage ();
+               return;
        }
 
-       if (*p)
-               usage ();
+       config->sample_freq = freq;
 }
 
 static void