From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbdIVAqf (ORCPT ); Thu, 21 Sep 2017 20:46:35 -0400 Received: from mga11.intel.com ([192.55.52.93]:55499 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750AbdIVAqe (ORCPT ); Thu, 21 Sep 2017 20:46:34 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,426,1500966000"; d="scan'208";a="154678305" Subject: Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header To: Jiri Olsa 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 References: <1505920357-25561-1-git-send-email-yao.jin@linux.intel.com> <1505920357-25561-2-git-send-email-yao.jin@linux.intel.com> <20170921151842.GB6579@krava> <20170921152110.GC6579@krava> From: "Jin, Yao" Message-ID: Date: Fri, 22 Sep 2017 08:46:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170921152110.GC6579@krava> Content-Type: text/plain; charset=utf-8 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 9/21/2017 11:21 PM, Jiri Olsa wrote: > On Thu, Sep 21, 2017 at 05:18:42PM +0200, Jiri Olsa wrote: >> On Wed, Sep 20, 2017 at 11:12:32PM +0800, Jin Yao wrote: >> >> SNIP >> >>> @@ -2647,11 +2681,22 @@ int perf_file_header__read(struct perf_file_header *header, >>> >>> if (header->size != sizeof(*header)) { >>> /* Support the previous format */ >>> - if (header->size == offsetof(typeof(*header), adds_features)) >>> + if (header->size == offsetof(typeof(*header), adds_features)) { >>> bitmap_zero(header->adds_features, HEADER_FEAT_BITS); >>> - else >>> + header->first_sample_time = 0; >>> + header->last_sample_time = 0; >>> + format_feature = false; >>> + format_time = false; >>> + } else if (header->size == offsetof(typeof(*header), >>> + first_sample_time)) { >>> + header->first_sample_time = 0; >>> + header->last_sample_time = 0; >>> + format_time = false; >>> + } else >> >> ok, disregard my previou comment.. I should have read the full patch first ;-) > > still using the feature looks better to me.. I think we could > add some generic TLV data feature for cases like this > > jirka > Thanks for the comments! I will check how to add generic TLV data feature to record the first sample time and last sample time. Thanks Jin Yao