aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-10-07 14:53:17 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-10-10 11:43:49 -0300
commit7728fa0cfaeb7d25b12c8865c733359cc8e5fb13 (patch)
tree38b413ae51030cdc8006b3f000db7776915ea678 /tools/perf/builtin-top.c
parentperf tools: Use perf_mmap way to detect aux mmap (diff)
downloadwireguard-linux-7728fa0cfaeb7d25b12c8865c733359cc8e5fb13.tar.xz
wireguard-linux-7728fa0cfaeb7d25b12c8865c733359cc8e5fb13.zip
libperf: Adopt perf_mmap__consume() function from tools/perf
Move perf_mmap__consume() vrom tools/perf to libperf and export it in the perf/mmap.h header. Move also the needed helpers perf_mmap__write_tail(), perf_mmap__read_head() and perf_mmap__empty(). Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20191007125344.14268-10-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 611d03030abc..5fcf15799415 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -82,6 +82,7 @@
#include <linux/err.h>
#include <linux/ctype.h>
+#include <perf/mmap.h>
static volatile int done;
static volatile int resize;
@@ -883,7 +884,7 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
if (ret)
break;
- perf_mmap__consume(md);
+ perf_mmap__consume(&md->core);
if (top->qe.rotate) {
pthread_mutex_lock(&top->qe.mutex);