提交 b9de0f6e 编写于 作者: K Kan Liang 提交者: Arnaldo Carvalho de Melo

perf mmap: Use the stored data in perf_mmap__read_event()

Using the 'start', 'end' and 'overwrite' which are stored in
struct perf_mmap to replace the parameters of perf_mmap__read_event().
The parameters will be discarded later.

No functional change.
Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
Suggested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: NJiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1520350567-80082-4-git-send-email-kan.liang@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 07a9461d
......@@ -76,8 +76,9 @@ static union perf_event *perf_mmap__read(struct perf_mmap *map,
* perf_mmap__read_done()
*/
union perf_event *perf_mmap__read_event(struct perf_mmap *map,
bool overwrite,
u64 *startp, u64 end)
bool overwrite __maybe_unused,
u64 *startp __maybe_unused,
u64 end __maybe_unused)
{
union perf_event *event;
......@@ -87,17 +88,14 @@ union perf_event *perf_mmap__read_event(struct perf_mmap *map,
if (!refcount_read(&map->refcnt))
return NULL;
if (startp == NULL)
return NULL;
/* non-overwirte doesn't pause the ringbuffer */
if (!overwrite)
end = perf_mmap__read_head(map);
if (!map->overwrite)
map->end = perf_mmap__read_head(map);
event = perf_mmap__read(map, startp, end);
event = perf_mmap__read(map, &map->start, map->end);
if (!overwrite)
map->prev = *startp;
if (!map->overwrite)
map->prev = map->start;
return event;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册