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:   Thu, 21 Sep 2017 17:17:36 +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 v1 1/6] perf record: Record the first sample time and
 last sample time to perf file header

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ