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, 07 Nov 2013 09:06:06 -0700
From:	David Ahern <dsahern@...il.com>
To:	Ingo Molnar <mingo@...nel.org>
CC:	acme@...stprotocols.net, linux-kernel@...r.kernel.org,
	jolsa@...hat.com, Frederic Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Mike Galbraith <efault@....de>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 4/4] perf record: mmap output file - v3

On 11/7/13, 1:03 AM, Ingo Molnar wrote:
>
> * David Ahern <dsahern@...il.com> wrote:
>
>> +--out-pages=::
>> +	Number of pages to mmap while writing data to file (must be a power of two).
>> +	Specification can be appended with unit character - B/K/M/G. The
>> +	size is rounded up to have nearest pages power of two value.
>
> So why doesn't the code automatically round down (or up) to the next power
> of 2 limit? We use computers to solve problems, not to introduce
> additional ones! ;-)

sure. It reuses perf_evlist__parse_mmap_pages which rounds so I will 
update the description.



>> +static int do_mmap_output(struct perf_record *rec, void *buf, size_t size)
>> +{
>> +	struct perf_data_file *file = &rec->file;
>> +	u64 remaining;
>> +	off_t offset;
>> +
>> +	if (rec->mmap_addr == NULL) {
>> +do_mmap:
>> +		offset = rec->session->header.data_offset + rec->bytes_written;
>> +		if (offset < (ssize_t) rec->mmap_out_size) {
>> +			rec->mmap_offset = offset;
>> +			offset = 0;
>> +		} else
>> +			rec->mmap_offset = 0;
>
> (Nit: unbalanced curly braces.)

I believe checkpatch.pl complains, but will add.


>> +	OPT_CALLBACK(0, "out-pages", &record.mmap_out_pages, "pages",
>> +		     "number of pages to use for output chunks.",
>> +		     perf_evlist__parse_mmap_pages),
>
> Nit: the short explanation here doesn't mention it at all to the user that
> these 'out pages' are used in mmap.
>
> Shouldn't it say:
>
> 		     "number of pages mmap()ed for output chunks."
>
> ?
>
> Also, what happens if a user sets it to zero?

I was intending to use that as a way of disabling the mmap output - go 
back to write(). I'll update the documentation.

Ack on all of the other comments.

David

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ