From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751528AbdKVAzK (ORCPT ); Tue, 21 Nov 2017 19:55:10 -0500 Received: from mga03.intel.com ([134.134.136.65]:35506 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbdKVAzJ (ORCPT ); Tue, 21 Nov 2017 19:55:09 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,432,1505804400"; d="scan'208";a="4457520" Subject: Re: [PATCH v6 1/6] perf header: Record first sample time and last sample time in perf file header To: Arnaldo Carvalho de Melo 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 References: <1509970871-20996-1-git-send-email-yao.jin@linux.intel.com> <1509970871-20996-2-git-send-email-yao.jin@linux.intel.com> <20171121163854.GM7918@kernel.org> From: "Jin, Yao" Message-ID: Date: Wed, 22 Nov 2017 08:55:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171121163854.GM7918@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/22/2017 12:38 AM, Arnaldo Carvalho de Melo wrote: > Em Mon, Nov 06, 2017 at 08:21:06PM +0800, Jin Yao escreveu: >> perf report/script/... have a --time option to limit the time range >> of output. That's very useful to slice large traces, e.g. when processing >> the output of perf script for some analysis. >> >> But right now --time only supports absolute time. Also there is no fast >> way to get the start/end times of a given trace except for looking at it. >> This makes it hard to e.g. only decode the first half of the trace, which >> is useful for parallelization of scripts >> >> Another problem is that perf records are variable size and there is no >> synchronization mechanism. So the only way to find the last sample reliably >> would be to walk all samples. But we want to avoid that in perf report/... >> because it is already quite expensive. That is why storing the first sample >> time and last sample time in perf record is better. >> >> This patch creates a new header feature type HEADER_SAMPLE_TIME and related >> ops. Save the first sample time and the last sample time to the feature >> section in perf file header > > I'll add a clarification here, right after your text: > > ". That will be done when, for instance, processing build-ids, where we > already have to process all samples to create the build-id table, take > advantage of that to further amortize that processing by storing > HEADER_SAMPLE_TIME to make 'perf report/script' faster when using > --time." > Thanks Arnaldo! The clarification is good! Thanks Jin Yao