From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752346AbeAEW4A (ORCPT + 1 other); Fri, 5 Jan 2018 17:56:00 -0500 Received: from mga05.intel.com ([192.55.52.43]:26881 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752147AbeAEWz7 (ORCPT ); Fri, 5 Jan 2018 17:55:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,320,1511856000"; d="scan'208";a="192620045" Subject: Re: [PATCH v7 2/6] perf record: Get the first sample time and last sample time 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: <1512738826-2628-1-git-send-email-yao.jin@linux.intel.com> <1512738826-2628-3-git-send-email-yao.jin@linux.intel.com> <20180104190903.GB20593@kernel.org> <20180105125341.GA25476@kernel.org> From: "Jin, Yao" Message-ID: <65a7172d-7e19-faec-d7c6-5384fc9d5b20@linux.intel.com> Date: Sat, 6 Jan 2018 06:55:56 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180105125341.GA25476@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 Return-Path: On 1/5/2018 8:53 PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jan 05, 2018 at 09:15:03AM +0800, Jin, Yao escreveu: >> >> >> On 1/5/2018 3:09 AM, Arnaldo Carvalho de Melo wrote: >>> Em Fri, Dec 08, 2017 at 09:13:42PM +0800, Jin Yao escreveu: >>>> In the default 'perf record' configuration, all samples are processed, >>>> to create the HEADER_BUILD_ID table. 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(). >>>> >>>> Later, at post processing time, perf report/script will fetch >>>> the time from perf file header. >>> >>> So, at this point I was expecting that that record would be present on >>> the perf.data file: >>> >>> [acme@jouet perf]$ perf record --timestamp-boundary sleep 1 >>> Cannot read kernel map >>> [ perf record: Woken up 1 times to write data ] >>> [ perf record: Captured and wrote 0.001 MB perf.data (7 samples) ] >>> [acme@jouet perf]$ perf report -D | grep PERF_RECORD_SAMPLE | wc -l >>> 7 >>> [acme@jouet perf]$ perf report -D | grep PERF_RECORD_SAMPLE_TIME >>> [acme@jouet perf]$ >>> >>> What am I doing wrong? >>> >>> To clarify, this is with just the first two patches in this series >>> applied. >>> >>> - Arnaldo >> >> Hi Arnaldo, >> >> The timestamp boundary information is saved in perf file header. > > Right, my bad, I somehow thought it would be as PERF_RECORD_SAMPLE_TIME, > duh. > > Will continue reviewing, sorry about that. > > - Arnaldo > Thanks for reviewing the patch. If you see anything I should improve, please let me know. Thanks Jin Yao >> So if we want to look at them, we need to add '--header' in perf report. >> >> For example, >> >> root@skl:/tmp# perf report -D --header | grep 'time of' >> # time of first sample : 248333.706656 >> # time of last sample : 248357.215328 >> >> Thanks >> Jin Yao