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, 7 Mar 2019 17:51:46 +0300
From:   Alexey Budankov <alexey.budankov@...ux.intel.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Andi Kleen <ak@...ux.intel.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 07/10] perf record: implement -z,--compression_level=n
 option and compression


On 07.03.2019 14:59, Jiri Olsa wrote:
> On Thu, Mar 07, 2019 at 11:26:16AM +0300, Alexey Budankov wrote:
>>
>> On 05.03.2019 15:26, Jiri Olsa wrote:
>>> On Fri, Mar 01, 2019 at 06:58:32PM +0300, Alexey Budankov wrote:
>>>
>>> SNIP
>>>
>>>> +static size_t record__process_comp_header(void *record, size_t increment)
>>>> +{
>>>> +	struct compressed_event *event = record;
>>>> +	size_t size = sizeof(struct compressed_event);
>>>> +
>>>> +	if (increment) {
>>>> +		event->header.size += increment;
>>>> +		return increment;
>>>> +	} else {
>>>> +		event->header.type = PERF_RECORD_COMPRESSED;
>>>> +		event->header.size = size;
>>>> +		return size;
>>>> +	}
>>>
>>> so zstd_compress_stream_to_records calls this in the loop:
>>>
>>>           while (input.pos < input.size) {
>>> 	  	...
>>>                 size = process_header(record, 0);
>>> 		...
>>>                 size = process_header(record, size);
>>> 	}
>>>
>>> the header.size will get overwritten with every new iteration, no?
>>
>> Every new record is headed by PERF_RECORD_COMPRESSED header an updated with 
>> resulted compressed frame size after compression. 
>>
>> process_header(, 0) puts header, then 
>> compression puts compressed frame, then 
>> process_header(, N) updates header.size value (+=).
> 
> and then process_header(, 0) is called again no?

Yes, in the next iteration these three steps repeat for the next record.

~Alexey

> 
> jirka
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ