xref: /openbmc/linux/tools/perf/util/time-utils.h (revision 4da722ca)
1 #ifndef _TIME_UTILS_H_
2 #define _TIME_UTILS_H_
3 
4 #include <stddef.h>
5 #include <linux/types.h>
6 
7 struct perf_time_interval {
8 	u64 start, end;
9 };
10 
11 int parse_nsec_time(const char *str, u64 *ptime);
12 
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 
17 int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz);
18 
19 int fetch_current_timestamp(char *buf, size_t sz);
20 
21 #endif
22