lkml.org 
[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Process-wide watchpoints
On Wed, Feb 3, 2021 at 2:37 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Feb 03, 2021 at 01:49:56PM +0100, Dmitry Vyukov wrote:
> > On Wed, Feb 3, 2021 at 1:29 PM Peter Zijlstra <peterz@infradead.org> wrote:
> > >
> > > On Mon, Feb 01, 2021 at 09:50:20AM +0100, Dmitry Vyukov wrote:
> > > > Or, alternatively would it be reasonable for perf to generate SIGTRAP
> > > > directly on watchpoint hit (like ptrace does)? That's what I am
> > > > ultimately trying to do by attaching a bpf program.
> > >
> > > Perf should be able to generate signals, The perf_event_open manpage
> > > lists two ways of trigering signals. The second way doesn't work for
> > > you, due to it not working on inherited counters, but would the first
> > > work?
> > >
> > > That is, set attr::wakeup_events and fcntl(F_SETSIG).
> >
> > The problem is that this sends a signal to the fd owner rather than
> > the thread that hit the breakpoint. At least that's what happened in
> > our tests. We would like to send a signal to the thread that hit the
> > breakpoint.
>
> Ah indeed.. all of this was aimed at self-monitoring.
>
> Letting perf send a signal to the monitored task is intrusive.. let me
> think on that.

I was thinking of something very similar to that bpf_send_signal that
delays sending to exit from irq:
https://elixir.bootlin.com/linux/latest/source/kernel/trace/bpf_trace.c#L1091

\
 
 \ /
  Last update: 2021-02-04 09:13    [W:0.087 / U:2.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site