From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752774AbdI0MQU (ORCPT ); Wed, 27 Sep 2017 08:16:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17011 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752521AbdI0MQS (ORCPT ); Wed, 27 Sep 2017 08:16:18 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6967281E0E Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Wed, 27 Sep 2017 14:16:14 +0200 From: Jiri Olsa To: Jin Yao Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com Subject: Re: [PATCH v2 2/6] perf record: Get the first sample time and last sample time Message-ID: <20170927121614.GA563@krava> References: <1506423482-16894-1-git-send-email-yao.jin@linux.intel.com> <1506423482-16894-3-git-send-email-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506423482-16894-3-git-send-email-yao.jin@linux.intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 27 Sep 2017 12:16:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 26, 2017 at 06:57:58PM +0800, Jin Yao wrote: > In perf record, it's walked on all samples yet. So it's very easy to get > the first/last samples and save the time to perf file header via the > function write_sample_time(). > > In later, perf report/script will fetch the time from perf file header. > > Signed-off-by: Jin Yao > --- > tools/perf/builtin-record.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index 9b379f3..3428633 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -80,6 +80,8 @@ struct record { > bool timestamp_filename; > struct switch_output switch_output; > unsigned long long samples; > + u64 first_sample_time; > + u64 last_sample_time; so we have those 2 u64 already in 3 structs: evlist, session and now record can't we do that with just in one? I'd think all of them should be available and reachable everywhere jirka