[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160713140701.GD31742@krava>
Date: Wed, 13 Jul 2016 16:07:01 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Wang Nan <wangnan0@...wei.com>
Cc: acme@...nel.org, lizefan@...wei.com, linux-kernel@...r.kernel.org,
pi3orama@....com, He Kuang <hekuang@...wei.com>,
Arnaldo Carvalho de Melo <acme@...hat.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 09/12] perf record: Read from overwritable ring buffer
On Tue, Jul 12, 2016 at 10:00:09AM +0000, Wang Nan wrote:
SNIP
> @@ -131,9 +156,10 @@ rb_find_range(void *data, int mask, u64 head, u64 old,
> return backward_rb_find_range(data, mask, head, start, end);
> }
>
> -static int record__mmap_read(struct record *rec, struct perf_evlist *evlist, int idx)
> +static int
> +record__mmap_read(struct record *rec, struct perf_mmap *md,
> + bool overwrite, bool backward)
> {
> - struct perf_mmap *md = &evlist->mmap[idx];
> u64 head = perf_mmap__read_head(md);
> u64 old = md->prev;
> u64 end = head, start = old;
> @@ -143,7 +169,7 @@ static int record__mmap_read(struct record *rec, struct perf_evlist *evlist, int
> int rc = 0;
>
> if (rb_find_range(data, md->mask, head,
> - old, &start, &end, false))
> + old, &start, &end, backward))
> return -1;
>
> if (start == end)
> @@ -156,7 +182,7 @@ static int record__mmap_read(struct record *rec, struct perf_evlist *evlist, int
> WARN_ONCE(1, "failed to keep up with mmap data. (warn only once)\n");
>
> md->prev = head;
> - perf_evlist__mmap_consume(evlist, idx);
> + perf_mmap__consume(md, overwrite || backward);
> return 0;
> }
>
> @@ -181,7 +207,7 @@ static int record__mmap_read(struct record *rec, struct perf_evlist *evlist, int
> }
>
> md->prev = head;
> - perf_evlist__mmap_consume(evlist, idx);
> + perf_mmap__consume(md, overwrite || backward);
> out:
> return rc;
> }
> @@ -341,6 +367,75 @@ int auxtrace_record__snapshot_start(struct auxtrace_record *itr __maybe_unused)
could above hunks be moved into separate patch?
jirka
Powered by blists - more mailing lists