David Ahern | fdf9dc4 | 2016-11-29 10:15:41 -0700 | [diff] [blame] | 1 | #ifndef _TIME_UTILS_H_ |
| 2 | #define _TIME_UTILS_H_ |
| 3 | |
Arnaldo Carvalho de Melo | c5e4027 | 2017-04-19 16:12:39 -0300 | [diff] [blame] | 4 | #include <stddef.h> |
| 5 | #include <linux/types.h> |
| 6 | |
David Ahern | fdf9dc4 | 2016-11-29 10:15:41 -0700 | [diff] [blame] | 7 | struct perf_time_interval { |
| 8 | u64 start, end; |
| 9 | }; |
| 10 | |
David Ahern | c284d66 | 2016-11-29 10:15:42 -0700 | [diff] [blame] | 11 | int parse_nsec_time(const char *str, u64 *ptime); |
| 12 | |
David Ahern | fdf9dc4 | 2016-11-29 10:15:41 -0700 | [diff] [blame] | 13 | int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr); |
| 14 | |
| 15 | bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp); |
| 16 | |
Arnaldo Carvalho de Melo | c5e4027 | 2017-04-19 16:12:39 -0300 | [diff] [blame] | 17 | int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz); |
| 18 | |
| 19 | int fetch_current_timestamp(char *buf, size_t sz); |
| 20 | |
David Ahern | fdf9dc4 | 2016-11-29 10:15:41 -0700 | [diff] [blame] | 21 | #endif |