Lines Matching refs:ptime
18 int parse_nsec_time(const char *str, u64 *ptime) in parse_nsec_time() argument
47 *ptime = time_sec * NSEC_PER_SEC + time_nsec; in parse_nsec_time()
51 static int parse_timestr_sec_nsec(struct perf_time_interval *ptime, in parse_timestr_sec_nsec() argument
55 (parse_nsec_time(start_str, &ptime->start) != 0)) { in parse_timestr_sec_nsec()
60 (parse_nsec_time(end_str, &ptime->end) != 0)) { in parse_timestr_sec_nsec()
94 int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr) in perf_time__parse_str() argument
103 ptime->start = 0; in perf_time__parse_str()
104 ptime->end = 0; in perf_time__parse_str()
106 rc = parse_timestr_sec_nsec(ptime, start_str, end_str); in perf_time__parse_str()
111 if (rc == 0 && ptime->end && ptime->end < ptime->start) 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()
120 static int perf_time__parse_strs(struct perf_time_interval *ptime, in perf_time__parse_strs() argument
155 rc = perf_time__parse_str(ptime + i, arg); in perf_time__parse_strs()
161 rc = perf_time__parse_str(ptime + i, p); in perf_time__parse_strs()
167 if (ptime[i].end >= ptime[i + 1].start) { in perf_time__parse_strs()
199 static int set_percent_time(struct perf_time_interval *ptime, double start_pcnt, in set_percent_time() argument
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()
218 static int percent_slash_split(char *str, struct perf_time_interval *ptime, in percent_slash_split() argument
250 return set_percent_time(ptime, start_pcnt, end_pcnt, start, end); in percent_slash_split()
253 static int percent_dash_split(char *str, struct perf_time_interval *ptime, in percent_dash_split() argument
276 return set_percent_time(ptime, start_pcnt, end_pcnt, start, end); in percent_dash_split()
395 struct perf_time_interval *ptime; in perf_time__range_alloc() local
415 ptime = calloc(i, sizeof(*ptime)); in perf_time__range_alloc()
416 return ptime; in perf_time__range_alloc()
419 bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp) in perf_time__skip_sample() argument
426 if ((ptime->start && timestamp < ptime->start) || in perf_time__skip_sample()
427 (ptime->end && timestamp > ptime->end)) { in perf_time__skip_sample()
437 struct perf_time_interval *ptime; in perf_time__ranges_skip_sample() local
450 ptime = &ptime_buf[i]; in perf_time__ranges_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()