Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1743198

Re: [PATCH v3 1/6] perf header: Record first sample time and last sample time in perf file header

From "Jin, Yao" <yao.jin@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/6] perf header: Record first sample time and last sample time in perf file header
Date 2017-10-02 15:00 +0200
Message-ID <uw8ue-7od-9@gated-at.bofh.it> (permalink)
References <uuyVP-4fP-7@gated-at.bofh.it> <uuyVQ-4fP-19@gated-at.bofh.it> <uw7y9-6Pz-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 10/2/2017 7:50 PM, Jiri Olsa wrote:
> 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
> 

Could I add the printing of duration? For example,

duration = (double)(last_sample_time - first_sample_time) / NSEC_PER_MSEC;
fprintf(fp, "# sample duration: %10.3f (ms)\n", duration);

fprintf(fp, "# time of first sample : %" PRIu64 "\n",
        first_sample_time);

fprintf(fp, "# time of last sample : %" PRIu64 "\n",
        last_sample_time);

Thanks
Jin Yao

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 1/6] perf header: Record first sample time and last sample time in perf file header Jin Yao <yao.jin@linux.intel.com> - 2017-09-28 06:50 +0200
  Re: [PATCH v3 1/6] perf header: Record first sample time and last  sample time in perf file header Jiri Olsa <jolsa@redhat.com> - 2017-10-02 14:00 +0200
    Re: [PATCH v3 1/6] perf header: Record first sample time and last  sample time in perf file header "Jin, Yao" <yao.jin@linux.intel.com> - 2017-10-02 15:00 +0200
      Re: [PATCH v3 1/6] perf header: Record first sample time and last  sample time in perf file header Jiri Olsa <jolsa@redhat.com> - 2017-10-02 15:10 +0200

csiph-web