6 #include "util/debug.h"
7 #include "util/parse-sublevel-options.h"
9 static int parse_one_sublevel_option(const char *str,
10 struct sublevel_option *opts)
12 struct sublevel_option *opt = opts;
13 char *vstr, *s = strdup(str);
17 pr_err("no memory\n");
21 vstr = strchr(s, '=');
26 if (!strcmp(s, opt->name))
32 pr_err("Unknown option name '%s'\n", s);
45 /* parse options like --foo a=<n>,b,c... */
46 int perf_parse_sublevel_options(const char *str, struct sublevel_option *opts)
48 char *s = strdup(str);
53 pr_err("no memory\n");
59 ret = parse_one_sublevel_option(p, opts);
65 p = strtok(NULL, ",");