From fdf9dc4b34f5f40919370c4601eccfd0db726aa5 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Tue, 29 Nov 2016 10:15:41 -0700 Subject: perf tools: Add time-based utility functions Add function to parse a user time string of the form , where start and stop are time in sec.nsec format. Both start and stop times are optional. Add function to determine if a sample time is within a given time time window of interest. Signed-off-by: David Ahern Acked-by: Namhyung Kim Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1480439746-42695-2-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/time-utils.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tools/perf/util/time-utils.h (limited to 'tools/perf/util/time-utils.h') diff --git a/tools/perf/util/time-utils.h b/tools/perf/util/time-utils.h new file mode 100644 index 000000000000..8f3e0e370be8 --- /dev/null +++ b/tools/perf/util/time-utils.h @@ -0,0 +1,12 @@ +#ifndef _TIME_UTILS_H_ +#define _TIME_UTILS_H_ + +struct perf_time_interval { + u64 start, end; +}; + +int perf_time__parse_str(struct perf_time_interval *ptime, const char *ostr); + +bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp); + +#endif -- cgit v1.2.3