lkml.org 
[lkml]   [2016]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] perf tool: Add time-based utility functions
On Fri, Nov 25, 2016 at 02:39:54PM -0700, David Ahern wrote:
> From: David Ahern <dsahern@gmail.com>
>
> 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>
> ---
> tools/perf/util/Build | 1 +
> tools/perf/util/time-utils.c | 85 ++++++++++++++++++++++++++++++++++++++++++++
> tools/perf/util/time-utils.h | 12 +++++++
> 3 files changed, 98 insertions(+)
> create mode 100644 tools/perf/util/time-utils.c
> create mode 100644 tools/perf/util/time-utils.h
>
> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> index 1dc67efad634..78f139978e7a 100644
> --- a/tools/perf/util/Build
> +++ b/tools/perf/util/Build
> @@ -87,6 +87,7 @@ libperf-y += help-unknown-cmd.o
> libperf-y += mem-events.o
> libperf-y += vsprintf.o
> libperf-y += drv_configs.o
> +libperf-y += time-utils.o
>
> libperf-$(CONFIG_LIBBPF) += bpf-loader.o
> libperf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
> diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c
> new file mode 100644
> index 000000000000..e584aeae9834
> --- /dev/null
> +++ b/tools/perf/util/time-utils.c
> @@ -0,0 +1,85 @@
> +#include <string.h>
> +#include <sys/time.h>
> +#include <time.h>
> +#include <errno.h>
> +#include <inttypes.h>
> +
> +#include "../perf.h"

could be just "perf.h"

jirka

\
 
 \ /
  Last update: 2016-11-28 15:00    [W:0.087 / U:1.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site