From 1764b7e2632bd398320eee8df0141c129c10d516 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 12 Jul 2017 16:06:11 +0200 Subject: [PATCH] [profiler] Drop support for the old-style sample option. --- mono/profiler/log-args.c | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/mono/profiler/log-args.c b/mono/profiler/log-args.c index c4d0c08f98c..a18572cc08d 100644 --- a/mono/profiler/log-args.c +++ b/mono/profiler/log-args.c @@ -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 -- 2.11.4.GIT