[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5786F1B1.40307@huawei.com>
Date: Thu, 14 Jul 2016 09:58:09 +0800
From: "Wangnan (F)" <wangnan0@...wei.com>
To: Jiri Olsa <jolsa@...hat.com>
CC: <acme@...nel.org>, <lizefan@...wei.com>,
<linux-kernel@...r.kernel.org>, <pi3orama@....com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
He Kuang <hekuang@...wei.com>, Jiri Olsa <jolsa@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Nilay Vaish <nilayvaish@...il.com>
Subject: Re: [PATCH v15 03/12] perf tools: Update perf evlist mmap related
APIs and helpers
On 2016/7/13 22:06, Jiri Olsa wrote:
> On Tue, Jul 12, 2016 at 10:00:03AM +0000, Wang Nan wrote:
>
> SNIP
>
>> -union perf_event *perf_evlist__mmap_read_forward(struct perf_evlist *evlist, int idx)
>> +union perf_event *perf_mmap__read_forward(struct perf_mmap *md, bool overwrite)
>> {
>> - struct perf_mmap *md = &evlist->mmap[idx];
>> u64 head;
>> u64 old = md->prev;
>>
>> @@ -795,13 +795,12 @@ union perf_event *perf_evlist__mmap_read_forward(struct perf_evlist *evlist, int
>>
>> head = perf_mmap__read_head(md);
>>
>> - return perf_mmap__read(md, evlist->overwrite, old, head, &md->prev);
>> + return perf_mmap__read(md, overwrite, old, head, &md->prev);
>> }
>>
>> union perf_event *
>> -perf_evlist__mmap_read_backward(struct perf_evlist *evlist, int idx)
>> +perf_mmap__read_backward(struct perf_mmap *md, bool overwrite __maybe_unused)
>> {
>> - struct perf_mmap *md = &evlist->mmap[idx];
>> u64 head, end;
>> u64 start = md->prev;
>>
>> @@ -836,6 +835,20 @@ perf_evlist__mmap_read_backward(struct perf_evlist *evlist, int idx)
>> return perf_mmap__read(md, false, start, end, &md->prev);
> should you pas evlist->overwrite in here?
No need. The second arg of perf_mmap__read() is not 'overwrite', but
'check_messup'.
When set to 'true', stop reading if caller require a buffer larger than
half of the
size of the ring buffer and report a warning. Only forward, read-only
ring buffer
requires this check. We can always read the whole backward ring buffer
because we
pause it before reading.
I'll add more comments here.
Thank you.
> thanks,
> jirka
Powered by blists - more mailing lists