perf tools: Support reading from backward ring buffer
authorWang Nan <wangnan0@huawei.com>
Mon, 9 May 2016 01:47:50 +0000 (01:47 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 9 May 2016 20:20:53 +0000 (17:20 -0300)
commite24c7520ea9c3e5bb51592c2134aafbf75a3f88a
treefe6c5e5e1f3ef7676b71a3e3b555a2a6a2647232
parentaff633406ca2772554bad7b37f2dfbc409b6ea74
perf tools: Support reading from backward ring buffer

perf_evlist__mmap_read_backward() is introduced for reading backward
ring buffer. Since direction for reading such ring buffer is different
from the direction kernel writing to it, and since user need to fetch
most recent record from it, a perf_evlist__mmap_read_catchup() is
introduced to move the reading pointer to the end of the buffer.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1462758471-89706-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evlist.c
tools/perf/util/evlist.h