Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-25 Thread Ingo Molnar
* Marco Elver wrote: > > Yeah, so why cannot we allocate enough space from the signal > > handler user-space stack and put the attr there, and point to it > > from sig_info? > > > > The idea would be to create a stable, per-signal snapshot of > > whatever the perf_attr state is at the

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-25 Thread Marco Elver
On Thu, 25 Mar 2021 at 15:18, Ingo Molnar wrote: > > * Dmitry Vyukov wrote: > > > On Wed, Mar 24, 2021 at 3:05 PM Marco Elver wrote: > > > > > > On Wed, 24 Mar 2021 at 15:01, Peter Zijlstra wrote: > > > > > > > > One last try, I'll leave it alone now, I promise :-) > > > > > > This looks like

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-25 Thread Ingo Molnar
* Dmitry Vyukov wrote: > On Wed, Mar 24, 2021 at 3:05 PM Marco Elver wrote: > > > > On Wed, 24 Mar 2021 at 15:01, Peter Zijlstra wrote: > > > > > > One last try, I'll leave it alone now, I promise :-) > > > > This looks like it does what you suggested, thanks! :-) > > > > I'll still need to

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-25 Thread Marco Elver
On Wed, 24 Mar 2021 at 15:15, Dmitry Vyukov wrote: > On Wed, Mar 24, 2021 at 3:12 PM Dmitry Vyukov wrote: > > > On Wed, 24 Mar 2021 at 15:01, Peter Zijlstra wrote: > > > > > > > > One last try, I'll leave it alone now, I promise :-) > > > > > > This looks like it does what you suggested,

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Dmitry Vyukov
On Wed, Mar 24, 2021 at 3:12 PM Dmitry Vyukov wrote: > > On Wed, 24 Mar 2021 at 15:01, Peter Zijlstra wrote: > > > > > > One last try, I'll leave it alone now, I promise :-) > > > > This looks like it does what you suggested, thanks! :-) > > > > I'll still need to think about it, because of the

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Dmitry Vyukov
On Wed, Mar 24, 2021 at 3:05 PM Marco Elver wrote: > > On Wed, 24 Mar 2021 at 15:01, Peter Zijlstra wrote: > > > > One last try, I'll leave it alone now, I promise :-) > > This looks like it does what you suggested, thanks! :-) > > I'll still need to think about it, because of the potential

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Marco Elver
On Wed, 24 Mar 2021 at 15:01, Peter Zijlstra wrote: > > One last try, I'll leave it alone now, I promise :-) This looks like it does what you suggested, thanks! :-) I'll still need to think about it, because of the potential problem with modify-signal-races and what the user's synchronization

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Peter Zijlstra
One last try, I'll leave it alone now, I promise :-) --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -778,6 +778,9 @@ struct perf_event { void *security; #endif struct list_headsb_list; + + unsigned long si_uattr; +

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Marco Elver
On Wed, 24 Mar 2021 at 14:21, Peter Zijlstra wrote: > > On Wed, Mar 24, 2021 at 02:01:56PM +0100, Peter Zijlstra wrote: > > On Wed, Mar 24, 2021 at 01:53:48PM +0100, Peter Zijlstra wrote: > > > On Wed, Mar 24, 2021 at 12:24:59PM +0100, Marco Elver wrote: > > > > Encode information from breakpoint

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Peter Zijlstra
On Wed, Mar 24, 2021 at 02:21:37PM +0100, Peter Zijlstra wrote: > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -5652,13 +5652,17 @@ static long _perf_ioctl(struct perf_even > return perf_event_query_prog_array(event, (void __user *)arg); > > case

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Peter Zijlstra
On Wed, Mar 24, 2021 at 02:01:56PM +0100, Peter Zijlstra wrote: > On Wed, Mar 24, 2021 at 01:53:48PM +0100, Peter Zijlstra wrote: > > On Wed, Mar 24, 2021 at 12:24:59PM +0100, Marco Elver wrote: > > > Encode information from breakpoint attributes into siginfo_t, which > > > helps disambiguate

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Peter Zijlstra
On Wed, Mar 24, 2021 at 01:53:48PM +0100, Peter Zijlstra wrote: > On Wed, Mar 24, 2021 at 12:24:59PM +0100, Marco Elver wrote: > > Encode information from breakpoint attributes into siginfo_t, which > > helps disambiguate which breakpoint fired. > > > > Note, providing the event fd may be

Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Peter Zijlstra
On Wed, Mar 24, 2021 at 12:24:59PM +0100, Marco Elver wrote: > Encode information from breakpoint attributes into siginfo_t, which > helps disambiguate which breakpoint fired. > > Note, providing the event fd may be unreliable, since the event may have > been modified (via

[PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP

2021-03-24 Thread Marco Elver
Encode information from breakpoint attributes into siginfo_t, which helps disambiguate which breakpoint fired. Note, providing the event fd may be unreliable, since the event may have been modified (via PERF_EVENT_IOC_MODIFY_ATTRIBUTES) between the event triggering and the signal being delivered