summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 772f1057647f..50591e07aa4f 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -2234,27 +2234,9 @@ static int parse_control_option(const struct option *opt,
const char *str,
int unset __maybe_unused)
{
- char *comma = NULL, *endptr = NULL;
- struct record_opts *config = (struct record_opts *)opt->value;
-
- if (strncmp(str, "fd:", 3))
- return -EINVAL;
-
- config->ctl_fd = strtoul(&str[3], &endptr, 0);
- if (endptr == &str[3])
- return -EINVAL;
-
- comma = strchr(str, ',');
- if (comma) {
- if (endptr != comma)
- return -EINVAL;
-
- config->ctl_fd_ack = strtoul(comma + 1, &endptr, 0);
- if (endptr == comma + 1 || *endptr != '\0')
- return -EINVAL;
- }
+ struct record_opts *opts = opt->value;
- return 0;
+ return evlist__parse_control(str, &opts->ctl_fd, &opts->ctl_fd_ack);
}
static void switch_output_size_warn(struct record *rec)