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


Groups > linux.kernel > #1736761

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

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header
Date 2017-09-21 17:20 +0200
Message-ID <usbqF-2Ji-3@gated-at.bofh.it> (permalink)
References <urHsB-8f3-7@gated-at.bofh.it> <urHsB-8f3-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 = bswap_64(header->first_sample_time);
> +		header->last_sample_time = bswap_64(header->last_sample_time);
> +	}
> +
>  	memcpy(&ph->adds_features, &header->adds_features,
>  	       sizeof(ph->adds_features));
>  
> @@ -2942,6 +2992,9 @@ int perf_session__read_header(struct perf_session *session)
>  		lseek(fd, tmp, SEEK_SET);
>  	}
>  
> +	session->first_sample_time = f_header.first_sample_time;
> +	session->last_sample_time = f_header.last_sample_time;
> +
>  	symbol_conf.nr_events = nr_attrs;
>  
>  	perf_header__process_sections(header, fd, &session->tevent,
> diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
> index f7a16ee..cba51e8 100644
> --- a/tools/perf/util/header.h
> +++ b/tools/perf/util/header.h
> @@ -56,6 +56,8 @@ struct perf_file_header {
>  	/* event_types is ignored */
>  	struct perf_file_section	event_types;
>  	DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS);
> +	u64				first_sample_time;
> +	u64				last_sample_time;

you can't add it here just like that, because you lose the
backward compatibility.. you need to add new feature

jirka

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


Thread

[PATCH v1 0/6] perf report/script: Support percent and multiple range in --time option Jin Yao <yao.jin@linux.intel.com> - 2017-09-20 09:20 +0200
  [PATCH v1 1/6] perf record: Record the first sample time and last sample time to perf file header Jin Yao <yao.jin@linux.intel.com> - 2017-09-20 09:20 +0200
    Re: [PATCH v1 1/6] perf record: Record the first sample time and  last sample time to perf file header Jiri Olsa <jolsa@redhat.com> - 2017-09-21 17:20 +0200
    Re: [PATCH v1 1/6] perf record: Record the first sample time and  last sample time to perf file header Jiri Olsa <jolsa@redhat.com> - 2017-09-21 17:20 +0200
      Re: [PATCH v1 1/6] perf record: Record the first sample time and  last sample time to perf file header Jiri Olsa <jolsa@redhat.com> - 2017-09-21 17:30 +0200
        Re: [PATCH v1 1/6] perf record: Record the first sample time and last  sample time to perf file header "Jin, Yao" <yao.jin@linux.intel.com> - 2017-09-22 02:50 +0200
  [PATCH v1 6/6] perf script: support time percent and multiple time ranges Jin Yao <yao.jin@linux.intel.com> - 2017-09-20 09:20 +0200
  [PATCH v1 2/6] perf Documentation: Update perf.data-file-format.txt Jin Yao <yao.jin@linux.intel.com> - 2017-09-20 09:20 +0200

csiph-web