diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2016-11-29 10:15:41 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-12-01 13:02:32 -0300 |
commit | fdf9dc4b34f5f40919370c4601eccfd0db726aa5 (patch) | |
tree | 035673547bf98ad5bf0208421683e05c593c6070 /tools/perf/util/time-utils.h | |
parent | 64eff7d9c4469b7e24fb7e5416a67ee5959c3f76 (diff) | |
download | linux-fdf9dc4b34f5f40919370c4601eccfd0db726aa5.tar.bz2 |
perf tools: Add time-based utility functions
Add function to parse a user time string of the form <start>,<stop>
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 <dsahern@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1480439746-42695-2-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/time-utils.h')
-rw-r--r-- | tools/perf/util/time-utils.h | 12 |
1 files changed, 12 insertions, 0 deletions
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 |