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


Groups > linux.kernel > #1740665 > unrolled thread

Re: [PATCH v2 2/6] perf record: Get the first sample time and last sample time

Started byJiri Olsa <jolsa@redhat.com>
First post2017-09-27 14:20 +0200
Last post2017-09-27 15:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 2/6] perf record: Get the first sample time and last  sample time Jiri Olsa <jolsa@redhat.com> - 2017-09-27 14:20 +0200
    Re: [PATCH v2 2/6] perf record: Get the first sample time and last  sample time "Jin, Yao" <yao.jin@linux.intel.com> - 2017-09-27 15:10 +0200

#1740665 — Re: [PATCH v2 2/6] perf record: Get the first sample time and last sample time

FromJiri Olsa <jolsa@redhat.com>
Date2017-09-27 14:20 +0200
SubjectRe: [PATCH v2 2/6] perf record: Get the first sample time and last sample time
Message-ID<uujtN-2gN-41@gated-at.bofh.it>
On Tue, Sep 26, 2017 at 06:57:58PM +0800, Jin Yao wrote:
> In perf record, it's walked on all samples yet. So it's very easy to get
> the first/last samples and save the time to perf file header via the
> function write_sample_time().
> 
> In later, perf report/script will fetch the time from perf file header.
> 
> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
> ---
>  tools/perf/builtin-record.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 9b379f3..3428633 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -80,6 +80,8 @@ struct record {
>  	bool			timestamp_filename;
>  	struct switch_output	switch_output;
>  	unsigned long long	samples;
> +	u64			first_sample_time;
> +	u64			last_sample_time;

so we have those 2 u64 already in 3 structs: evlist, session and now record

can't we do that with just in one? I'd think all of them should be available
and reachable everywhere

jirka

[toc] | [next] | [standalone]


#1740700

From"Jin, Yao" <yao.jin@linux.intel.com>
Date2017-09-27 15:10 +0200
Message-ID<uukga-35a-11@gated-at.bofh.it>
In reply to#1740665

On 9/27/2017 8:16 PM, Jiri Olsa wrote:
> On Tue, Sep 26, 2017 at 06:57:58PM +0800, Jin Yao wrote:
>> In perf record, it's walked on all samples yet. So it's very easy to get
>> the first/last samples and save the time to perf file header via the
>> function write_sample_time().
>>
>> In later, perf report/script will fetch the time from perf file header.
>>
>> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
>> ---
>>  tools/perf/builtin-record.c | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
>>
>> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
>> index 9b379f3..3428633 100644
>> --- a/tools/perf/builtin-record.c
>> +++ b/tools/perf/builtin-record.c
>> @@ -80,6 +80,8 @@ struct record {
>>  	bool			timestamp_filename;
>>  	struct switch_output	switch_output;
>>  	unsigned long long	samples;
>> +	u64			first_sample_time;
>> +	u64			last_sample_time;
> 
> so we have those 2 u64 already in 3 structs: evlist, session and now record
> 
> can't we do that with just in one? I'd think all of them should be available
> and reachable everywhere
> 
> jirka
> 

Thanks! 

Yes, you are right. It looks we only need to define them in evlist.

If no other comments, I will prepare v3 to fix this.

Thanks
Jin Yao

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web