From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875AbdIUPRm (ORCPT ); Thu, 21 Sep 2017 11:17:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49004 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbdIUPRk (ORCPT ); Thu, 21 Sep 2017 11:17:40 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F01802BEFF Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Thu, 21 Sep 2017 17:17:36 +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 v1 1/6] perf record: Record the first sample time and last sample time to perf file header Message-ID: <20170921151736.GA6579@krava> References: <1505920357-25561-1-git-send-email-yao.jin@linux.intel.com> <1505920357-25561-2-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: <1505920357-25561-2-git-send-email-yao.jin@linux.intel.com> User-Agent: Mutt/1.9.0 (2017-09-02) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 21 Sep 2017 15:17:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 20, 2017 at 11:12:32PM +0800, Jin Yao wrote: SNIP > @@ -2686,6 +2731,11 @@ int perf_file_header__read(struct perf_file_header *header, > } > } > > + if (ph->needs_swap && format_time) { > + header->first_sample_time = bswap_64(header->first_sample_time); > + header->last_sample_time = bswap_64(header->last_sample_time); > + } > + > memcpy(&ph->adds_features, &header->adds_features, > sizeof(ph->adds_features)); > > @@ -2942,6 +2992,9 @@ int perf_session__read_header(struct perf_session *session) > lseek(fd, tmp, SEEK_SET); > } > > + session->first_sample_time = f_header.first_sample_time; > + session->last_sample_time = f_header.last_sample_time; > + > symbol_conf.nr_events = nr_attrs; > > perf_header__process_sections(header, fd, &session->tevent, > diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h > index f7a16ee..cba51e8 100644 > --- a/tools/perf/util/header.h > +++ b/tools/perf/util/header.h > @@ -56,6 +56,8 @@ struct perf_file_header { > /* event_types is ignored */ > struct perf_file_section event_types; > DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS); > + u64 first_sample_time; > + u64 last_sample_time; you can't add it here just like that, because you lose the backward compatibility.. you need to add new feature jirka