From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751354AbdJBLvB (ORCPT ); Mon, 2 Oct 2017 07:51:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46244 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750903AbdJBLvA (ORCPT ); Mon, 2 Oct 2017 07:51:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C8055C0587E3 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Mon, 2 Oct 2017 13:50:57 +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 v3 1/6] perf header: Record first sample time and last sample time in perf file header Message-ID: <20171002115057.GA16128@krava> References: <1506602721-3784-1-git-send-email-yao.jin@linux.intel.com> <1506602721-3784-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: <1506602721-3784-2-git-send-email-yao.jin@linux.intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 02 Oct 2017 11:50:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 28, 2017 at 08:45:16PM +0800, Jin Yao wrote: SNIP > + return ret; > + > + return do_write(ff, &evlist->last_sample_time, > + sizeof(evlist->last_sample_time)); > +} > + > static void print_hostname(struct feat_fd *ff, FILE *fp) > { > fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname); > @@ -1506,6 +1520,19 @@ static void print_group_desc(struct feat_fd *ff, FILE *fp) > } > } > > +static void print_sample_time(struct feat_fd *ff, FILE *fp) > +{ > + struct perf_session *session; > + > + session = container_of(ff->ph, struct perf_session, header); > + > + fprintf(fp, "# time of first sample : %" PRIu64 "\n", > + session->evlist->first_sample_time); > + > + fprintf(fp, "# time of last sample : %" PRIu64 "\n", > + session->evlist->last_sample_time); this could be done in some follow up patch, but could we display this in some human readable way.. # time of first sample : 218077073264620 # time of last sample : 218077073395488 jirka