Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-21 Thread Jin, Yao
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

Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-21 Thread Jin, Yao
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

Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-21 Thread Jiri Olsa
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)) { > > /*

Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-21 Thread Jiri Olsa
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)) { > > /*

Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-21 Thread Jiri Olsa
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 ==

Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-21 Thread Jiri Olsa
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 ==

Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-21 Thread Jiri Olsa
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 =

Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-21 Thread Jiri Olsa
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 =

[PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-20 Thread Jin Yao
perf report/script/... have a --time option to limit the time range of output. That's very useful to slice large traces, e.g. when processing the output of perf script for some analysis. But right now --time only supports absolute time. Also there is no fast way to get the start/end times of a

[PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header

2017-09-20 Thread Jin Yao
perf report/script/... have a --time option to limit the time range of output. That's very useful to slice large traces, e.g. when processing the output of perf script for some analysis. But right now --time only supports absolute time. Also there is no fast way to get the start/end times of a