From: David Ahern <dsahern@gmail.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org,
jolsa@redhat.com, Frederic Weisbecker <fweisbec@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Namhyung Kim <namhyung@kernel.org>,
Mike Galbraith <efault@gmx.de>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 4/4] perf record: mmap output file - v3
Date: Thu, 07 Nov 2013 09:06:06 -0700 [thread overview]
Message-ID: <527BBA6E.2040609@gmail.com> (raw)
In-Reply-To: <20131107080313.GB31926@gmail.com>
On 11/7/13, 1:03 AM, Ingo Molnar wrote:
>
> * David Ahern <dsahern@gmail.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
next prev parent reply other threads:[~2013-11-07 16:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 18:41 [PATCH 0/4] perf record: Cleanups and mmap-based output David Ahern
2013-11-06 18:41 ` [PATCH 1/4] perf record: Refactor feature handling into a separate function David Ahern
2013-11-07 8:03 ` Ingo Molnar
2013-11-07 15:30 ` [tip:perf/core] " tip-bot for David Ahern
2013-11-06 18:41 ` [PATCH 2/4] perf record: Remove advance_output function David Ahern
2013-11-07 8:04 ` Ingo Molnar
2013-11-07 15:31 ` [tip:perf/core] " tip-bot for David Ahern
2013-11-06 18:41 ` [PATCH 3/4] perf record: Remove post_processing_offset variable David Ahern
2013-11-07 8:04 ` Ingo Molnar
2013-11-07 15:31 ` [tip:perf/core] " tip-bot for David Ahern
2013-11-06 18:41 ` [PATCH 4/4] perf record: mmap output file - v3 David Ahern
2013-11-07 8:03 ` Ingo Molnar
2013-11-07 16:06 ` David Ahern [this message]
2013-11-11 11:53 ` Ingo Molnar
2013-11-07 8:06 ` [PATCH 0/4] perf record: Cleanups and mmap-based output Ingo Molnar
2013-11-07 9:38 ` Jiri Olsa
2013-11-07 13:21 ` Jiri Olsa
2013-11-07 15:59 ` David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=527BBA6E.2040609@gmail.com \
--to=dsahern@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.