Lines Matching refs:str
15 int parse_nsec_time(const char *str, u64 *ptime) in parse_nsec_time() argument
20 time_sec = strtoul(str, &end, 10); in parse_nsec_time()
67 char *d, *str; in split_start_end() local
73 str = strdup(ostr); in split_start_end()
74 if (str == NULL) in split_start_end()
77 start_str = str; in split_start_end()
117 static int parse_percent(double *pcnt, char *str) in parse_percent() argument
122 c = strchr(str, '%'); in parse_percent()
128 d = strtod(str, &endptr); in parse_percent()
129 if (endptr != str + strlen(str)) in parse_percent()
136 static int percent_slash_split(char *str, struct perf_time_interval *ptime, in percent_slash_split() argument
150 p = strchr(str, '/'); in percent_slash_split()
155 if (parse_percent(&pcnt, str) < 0) in percent_slash_split()
180 static int percent_dash_split(char *str, struct perf_time_interval *ptime, in percent_dash_split() argument
192 ret = split_start_end(&start_str, &end_str, str, '-'); in percent_dash_split()
223 char *str, *p1, *p2; in percent_comma_split() local
226 str = strdup(ostr); in percent_comma_split()
227 if (str == NULL) in percent_comma_split()
230 len = strlen(str); in percent_comma_split()
231 p1 = str; in percent_comma_split()
233 while (p1 < str + len) { in percent_comma_split()
235 free(str); in percent_comma_split()
245 free(str); in percent_comma_split()
260 free(str); in percent_comma_split()
267 char *str; in one_percent_convert() local
280 str = malloc(len + 3); in one_percent_convert()
281 if (str == NULL) in one_percent_convert()
284 memcpy(str, ostr, len); in one_percent_convert()
285 strcpy(str + len, "/1"); in one_percent_convert()
287 ret = percent_slash_split(str, ptime_buf, start, end); in one_percent_convert()
291 free(str); in one_percent_convert()