lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 2 Oct 2017 16:15:10 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     "Jin, Yao" <yao.jin@...ux.intel.com>
Cc:     acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
        mingo@...hat.com, alexander.shishkin@...ux.intel.com,
        Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
        kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v3 1/6] perf header: Record first sample time and last
 sample time in perf file header

On Mon, Oct 02, 2017 at 09:48:31PM +0800, Jin, Yao wrote:
> 
> 
> On 10/2/2017 9:00 PM, Jiri Olsa wrote:
> > On Mon, Oct 02, 2017 at 08:52:59PM +0800, Jin, Yao wrote:
> >>
> >>
> >> 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);
> > 
> > could be, but mainly please display the time same way the perf script does:
> > 
> >   218482.819815
> > 
> > jirka
> > 
> 
> Fine. I think I can use timestamp__scnprintf_usec() to print the timestamp. 
> 
> BTW, do we need the duration printing here?

yea, might be helpful

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ