Lines Matching +full:range +full:- +full:double
1 // SPDX-License-Identifier: GPL-2.0
14 #include "time-utils.h"
25 return -1; in parse_nsec_time()
32 return -1; in parse_nsec_time()
43 return -1; in parse_nsec_time()
55 (parse_nsec_time(start_str, &ptime->start) != 0)) { in parse_timestr_sec_nsec()
56 return -1; in parse_timestr_sec_nsec()
60 (parse_nsec_time(end_str, &ptime->end) != 0)) { in parse_timestr_sec_nsec()
61 return -1; in parse_timestr_sec_nsec()
78 return -ENOMEM; in split_start_end()
103 ptime->start = 0; in perf_time__parse_str()
104 ptime->end = 0; in perf_time__parse_str()
111 if (rc == 0 && ptime->end && ptime->end < ptime->start) in perf_time__parse_str()
112 return -EINVAL; in perf_time__parse_str()
114 pr_debug("start time %" PRIu64 ", ", ptime->start); in perf_time__parse_str()
115 pr_debug("end time %" PRIu64 "\n", ptime->end); in perf_time__parse_str()
132 return -EINVAL; in perf_time__parse_strs()
138 return -ENOMEM; in perf_time__parse_strs()
141 for (i = 0, p = str; i < num - 1; i++) { in perf_time__parse_strs()
148 rc = -EINVAL; in perf_time__parse_strs()
166 for (i = 0; i < num - 1; i++) { in perf_time__parse_strs()
168 rc = -EINVAL; in perf_time__parse_strs()
180 static int parse_percent(double *pcnt, char *str) in parse_percent()
183 double d; in parse_percent()
189 return -1; in parse_percent()
193 return -1; in parse_percent()
199 static int set_percent_time(struct perf_time_interval *ptime, double start_pcnt, in set_percent_time()
200 double end_pcnt, u64 start, u64 end) in set_percent_time()
202 u64 total = end - start; in set_percent_time()
206 return -1; in set_percent_time()
209 ptime->start = start + round(start_pcnt * total); in set_percent_time()
210 ptime->end = start + round(end_pcnt * total); in set_percent_time()
212 if (ptime->end > ptime->start && ptime->end != end) in set_percent_time()
213 ptime->end -= 1; in set_percent_time()
222 double pcnt, start_pcnt, end_pcnt; in percent_slash_split()
233 return -1; in percent_slash_split()
237 return -1; in percent_slash_split()
242 return -1; in percent_slash_split()
245 return -1; in percent_slash_split()
247 start_pcnt = pcnt * (i - 1); in percent_slash_split()
257 double start_pcnt, end_pcnt; in percent_dash_split()
261 * Example: 0%-10% in percent_dash_split()
264 ret = split_start_end(&start_str, &end_str, str, '-'); in percent_dash_split()
271 return -1; in percent_dash_split()
291 return -ENOMEM; in percent_comma_split()
299 return -1; in percent_comma_split()
309 return -1; in percent_comma_split()
337 if (ostr + len - 1 != c) in one_percent_convert()
338 return -1; in one_percent_convert()
345 return -ENOMEM; in one_percent_convert()
366 * 0%-10%,30%-40%: multiple time range in perf_time__percent_parse_str()
378 c = strchr(ostr, '-'); in perf_time__percent_parse_str()
388 return -1; in perf_time__percent_parse_str()
398 * At least allocate one time range. in perf_time__range_alloc()
426 if ((ptime->start && timestamp < ptime->start) || in perf_time__skip_sample()
427 (ptime->end && timestamp > ptime->end)) { in perf_time__skip_sample()
452 if (timestamp >= ptime->start && in perf_time__ranges_skip_sample()
453 (timestamp <= ptime->end || !ptime->end)) { in perf_time__ranges_skip_sample()
469 int size, num, ret = -EINVAL; in perf_time__parse_for_ranges_reltime()
473 return -ENOMEM; in perf_time__parse_for_ranges_reltime()
476 if (session->evlist->first_sample_time == 0 && in perf_time__parse_for_ranges_reltime()
477 session->evlist->last_sample_time == 0) { in perf_time__parse_for_ranges_reltime()
480 "(if '--buildid-all' is enabled, please set '--timestamp-boundary').\n"); in perf_time__parse_for_ranges_reltime()
489 session->evlist->first_sample_time, in perf_time__parse_for_ranges_reltime()
490 session->evlist->last_sample_time); in perf_time__parse_for_ranges_reltime()
502 ptime_range[i].start += session->evlist->first_sample_time; in perf_time__parse_for_ranges_reltime()
503 ptime_range[i].end += session->evlist->first_sample_time; in perf_time__parse_for_ranges_reltime()
551 return -1; in fetch_current_timestamp()
554 return -1; in fetch_current_timestamp()