From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753830AbdJSUVb (ORCPT ); Thu, 19 Oct 2017 16:21:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:54918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752645AbdJSUVa (ORCPT ); Thu, 19 Oct 2017 16:21:30 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A58F82191C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Thu, 19 Oct 2017 17:21:27 -0300 From: Arnaldo Carvalho de Melo To: Jin Yao Cc: 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 v4 2/6] perf record: Get the first sample time and last sample time Message-ID: <20171019202127.GB30002@kernel.org> References: <1507040558-20344-1-git-send-email-yao.jin@linux.intel.com> <1507040558-20344-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: <1507040558-20344-3-git-send-email-yao.jin@linux.intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Oct 03, 2017 at 10:22:34PM +0800, Jin Yao escreveu: > In perf record, it's walked on all samples yet. So it's very easy to get You're saying that perf record walks all samples always? That only happens when we generate the build-id table, right? And people disable that to speed up the process, knowing that some limitations will come from that, for doing analysis right after running it is mostly OK to disable the build-id processing. - Arnaldo > 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. > > Change log: > ----------- > v3: Remove the definitions of first_sample_time and last_sample_time > from struct record and directly save them in perf_evlist. > > Signed-off-by: Jin Yao > --- > tools/perf/builtin-record.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index 9b379f3..d5b78449 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -488,6 +488,11 @@ static int process_sample_event(struct perf_tool *tool, > > rec->samples++; > > + if (rec->evlist->first_sample_time == 0) > + rec->evlist->first_sample_time = sample->time; > + > + rec->evlist->last_sample_time = sample->time; > + > return build_id__mark_dso_hit(tool, event, sample, evsel, machine); > } > > -- > 2.7.4