Re: [PATCH v3] perf record: Use an eventfd to wakeup when done

2020-05-24 Thread Anand K. Mistry
On Sat, 23 May 2020 at 23:35, Andi Kleen wrote: > > Anand K Mistry writes: > > } > > > > + done_fd = eventfd(0, EFD_NONBLOCK); > > This will make perf depend on a recent glibc or other library > that implements eventfd. Wouldn't surprise me if some kind > of build time check is needed f

Re: [PATCH v3] perf record: Use an eventfd to wakeup when done

2020-05-23 Thread Andi Kleen
Anand K Mistry writes: > } > > + done_fd = eventfd(0, EFD_NONBLOCK); This will make perf depend on a recent glibc or other library that implements eventfd. Wouldn't surprise me if some kind of build time check is needed for this to pass all of Arnaldo's built tests. -Andi

Re: [PATCH v3] perf record: Use an eventfd to wakeup when done

2020-05-20 Thread Arnaldo Carvalho de Melo
Em Wed, May 13, 2020 at 01:39:41PM +0200, Jiri Olsa escreveu: > On Wed, May 13, 2020 at 12:20:23PM +1000, Anand K Mistry wrote: > > The setting and checking of 'done' contains a rare race where the signal > > handler setting 'done' is run after checking to break the loop, but > > before waiting in

Re: [PATCH v3] perf record: Use an eventfd to wakeup when done

2020-05-13 Thread Arnaldo Carvalho de Melo
Em Wed, May 13, 2020 at 01:39:41PM +0200, Jiri Olsa escreveu: > On Wed, May 13, 2020 at 12:20:23PM +1000, Anand K Mistry wrote: > > The setting and checking of 'done' contains a rare race where the signal > > handler setting 'done' is run after checking to break the loop, but > > before waiting in

Re: [PATCH v3] perf record: Use an eventfd to wakeup when done

2020-05-13 Thread Jiri Olsa
On Wed, May 13, 2020 at 12:20:23PM +1000, Anand K Mistry wrote: > The setting and checking of 'done' contains a rare race where the signal > handler setting 'done' is run after checking to break the loop, but > before waiting in evlist__poll(). In this case, the main loop won't wake > up until eith

[PATCH v3] perf record: Use an eventfd to wakeup when done

2020-05-12 Thread Anand K Mistry
The setting and checking of 'done' contains a rare race where the signal handler setting 'done' is run after checking to break the loop, but before waiting in evlist__poll(). In this case, the main loop won't wake up until either another signal is sent, or the perf data fd causes a wake up. The fo