Messages in this thread | | | Date | Tue, 26 Jan 2016 16:25:28 +0800 | From | "Wangnan (F)" <> | Subject | Re: [PATCH 50/54] perf record: Toggle overwrite ring buffer for reading |
| |
On 2016/1/25 17:56, Wang Nan wrote: > Reading from a overwrite ring buffer is unrelible. perf_evsel__pause() > should be called before reading from them. > > Toggel overwrite_evt_paused director after receiving done or switch > output. > > Signed-off-by: Wang Nan <wangnan0@huawei.com> > Signed-off-by: He Kuang <hekuang@huawei.com> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com> > Cc: Jiri Olsa <jolsa@kernel.org> > Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> > Cc: Namhyung Kim <namhyung@kernel.org> > Cc: Zefan Li <lizefan@huawei.com> > Cc: pi3orama@163.com > --- > tools/perf/builtin-record.c | 77 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 77 insertions(+)
[SNIP]
> +static void > +record__toggle_overwrite_evsels(struct record *rec, > + enum overwrite_evt_state state) > +{
[SNIP]
> + rec->overwrite_evt_state = state; > + > + if (action == NONE) > + return; > + > + evlist__for_each(evlist, pos) { > + if (!pos->overwrite) > + continue; > + perf_evsel__pause(pos, action == PAUSE); > + } > +} > + This part is incorrect. We should pause ring buffers for each CPU in a channel, not each evsel.
Already fixed at:
https://git.kernel.org/cgit/linux/kernel/git/pi3orama/linux.git/commit/?h=perf/overwrite&id=fe59d9c6621c60087ce7e6e269f2f15f152d6d71
Thank you.
| |