From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933075AbcK1N7P (ORCPT ); Mon, 28 Nov 2016 08:59:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41214 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933010AbcK1N65 (ORCPT ); Mon, 28 Nov 2016 08:58:57 -0500 Date: Mon, 28 Nov 2016 14:58:40 +0100 From: Jiri Olsa To: David Ahern Cc: acme@kernel.org, mingo@kernel.org, peterz@infradead.org, namhyung@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, David Ahern Subject: Re: [PATCH 1/6] perf tool: Add time-based utility functions Message-ID: <20161128135840.GC1928@krava> References: <1480109999-36971-1-git-send-email-dsa@cumulusnetworks.com> <1480109999-36971-2-git-send-email-dsa@cumulusnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1480109999-36971-2-git-send-email-dsa@cumulusnetworks.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 28 Nov 2016 13:58:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 25, 2016 at 02:39:54PM -0700, David Ahern wrote: > From: David Ahern > > 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 > --- > 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 > +#include > +#include > +#include > +#include > + > +#include "../perf.h" could be just "perf.h" jirka