Lines Matching defs:ptime

18 int parse_nsec_time(const char *str, u64 *ptime)
47 *ptime = time_sec * NSEC_PER_SEC + time_nsec;
51 static int parse_timestr_sec_nsec(struct perf_time_interval *ptime,
55 (parse_nsec_time(start_str, &ptime->start) != 0)) {
60 (parse_nsec_time(end_str, &ptime->end) != 0)) {
94 int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr)
103 ptime->start = 0;
104 ptime->end = 0;
106 rc = parse_timestr_sec_nsec(ptime, start_str, end_str);
111 if (rc == 0 && ptime->end && ptime->end < ptime->start)
114 pr_debug("start time %" PRIu64 ", ", ptime->start);
115 pr_debug("end time %" PRIu64 "\n", ptime->end);
120 static int perf_time__parse_strs(struct perf_time_interval *ptime,
155 rc = perf_time__parse_str(ptime + i, arg);
161 rc = perf_time__parse_str(ptime + i, p);
167 if (ptime[i].end >= ptime[i + 1].start) {
199 static int set_percent_time(struct perf_time_interval *ptime, double start_pcnt,
209 ptime->start = start + round(start_pcnt * total);
210 ptime->end = start + round(end_pcnt * total);
212 if (ptime->end > ptime->start && ptime->end != end)
213 ptime->end -= 1;
218 static int percent_slash_split(char *str, struct perf_time_interval *ptime,
250 return set_percent_time(ptime, start_pcnt, end_pcnt, start, end);
253 static int percent_dash_split(char *str, struct perf_time_interval *ptime,
276 return set_percent_time(ptime, start_pcnt, end_pcnt, start, end);
395 struct perf_time_interval *ptime;
415 ptime = calloc(i, sizeof(*ptime));
416 return ptime;
419 bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp)
426 if ((ptime->start && timestamp < ptime->start) ||
427 (ptime->end && timestamp > ptime->end)) {
437 struct perf_time_interval *ptime;
450 ptime = &ptime_buf[i];
452 if (timestamp >= ptime->start &&
453 (timestamp <= ptime->end || !ptime->end)) {