Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Marco Elver
On Tue, Mar 23, 2021 at 10:47AM +0100, Marco Elver wrote: > On Tue, 23 Mar 2021 at 04:10, Ian Rogers wrote: > > On Mon, Mar 22, 2021 at 6:24 AM Marco Elver wrote: > > > On Wed, Mar 10, 2021 at 11:41AM +0100, Marco Elver wrote: > > > > Add kselftest to test that remove_on_exec removes inherited ev

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Peter Zijlstra
On Tue, Mar 23, 2021 at 04:58:37PM +0100, Marco Elver wrote: > On Tue, Mar 23, 2021 at 03:45PM +0100, Peter Zijlstra wrote: > > On Tue, Mar 23, 2021 at 11:32:03AM +0100, Peter Zijlstra wrote: > > > And at that point there's very little value in still using > > > perf_event_exit_event()... let me se

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Marco Elver
On Tue, Mar 23, 2021 at 03:45PM +0100, Peter Zijlstra wrote: > On Tue, Mar 23, 2021 at 11:32:03AM +0100, Peter Zijlstra wrote: > > And at that point there's very little value in still using > > perf_event_exit_event()... let me see if there's something to be done > > about that. > > I ended up wit

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Peter Zijlstra
On Tue, Mar 23, 2021 at 11:32:03AM +0100, Peter Zijlstra wrote: > And at that point there's very little value in still using > perf_event_exit_event()... let me see if there's something to be done > about that. I ended up with something like the below. Which then simplifies remove_on_exec() to:

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Marco Elver
On Tue, Mar 23, 2021 at 11:41AM +0100, Marco Elver wrote: > On Tue, 23 Mar 2021 at 11:32, Peter Zijlstra wrote: [...] > > > + if (parent_event) { > > > /* > > > + * Remove event from parent, to avoid race where the > > > +

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Marco Elver
On Tue, 23 Mar 2021 at 11:32, Peter Zijlstra wrote: > > On Tue, Mar 23, 2021 at 10:52:41AM +0100, Marco Elver wrote: > > > with efs->func==__perf_event_enable. I believe it's sufficient to add > > > > mutex_lock(&parent_event->child_mutex); > > list_del_init(&event->child_list); > >

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Peter Zijlstra
On Tue, Mar 23, 2021 at 10:52:41AM +0100, Marco Elver wrote: > with efs->func==__perf_event_enable. I believe it's sufficient to add > > mutex_lock(&parent_event->child_mutex); > list_del_init(&event->child_list); > mutex_unlock(&parent_event->child_mutex); > > right before rem

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Marco Elver
On Mon, Mar 22, 2021 at 05:42PM +0100, Peter Zijlstra wrote: > On Mon, Mar 22, 2021 at 02:24:40PM +0100, Marco Elver wrote: > > To make compatible with more recent libc, we'll need to fixup the tests > > with the below. > > OK, that reprodiced things here, thanks! > > The below seems to not explo

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-23 Thread Marco Elver
On Tue, 23 Mar 2021 at 04:10, Ian Rogers wrote: > On Mon, Mar 22, 2021 at 6:24 AM Marco Elver wrote: > > On Wed, Mar 10, 2021 at 11:41AM +0100, Marco Elver wrote: > > > Add kselftest to test that remove_on_exec removes inherited events from > > > child tasks. > > > > > > Signed-off-by: Marco Elve

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-22 Thread Ian Rogers
On Mon, Mar 22, 2021 at 6:24 AM Marco Elver wrote: > > On Wed, Mar 10, 2021 at 11:41AM +0100, Marco Elver wrote: > > Add kselftest to test that remove_on_exec removes inherited events from > > child tasks. > > > > Signed-off-by: Marco Elver > > To make compatible with more recent libc, we'll need

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-22 Thread Peter Zijlstra
On Mon, Mar 22, 2021 at 02:24:40PM +0100, Marco Elver wrote: > To make compatible with more recent libc, we'll need to fixup the tests > with the below. OK, that reprodiced things here, thanks! The below seems to not explode instantly it still has the alternative version in as well (and I thi

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-22 Thread Marco Elver
On Wed, Mar 10, 2021 at 11:41AM +0100, Marco Elver wrote: > Add kselftest to test that remove_on_exec removes inherited events from > child tasks. > > Signed-off-by: Marco Elver To make compatible with more recent libc, we'll need to fixup the tests with the below. Also, I've seen that tools/pe

[PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-10 Thread Marco Elver
Add kselftest to test that remove_on_exec removes inherited events from child tasks. Signed-off-by: Marco Elver --- v2: * Add patch to series. --- .../testing/selftests/perf_events/.gitignore | 1 + tools/testing/selftests/perf_events/Makefile | 2 +- .../selftests/perf_events/remove_on_ex