lkml.org 
[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Process-wide watchpoints
On Thu, Feb 04, 2021 at 09:10:11AM +0100, Dmitry Vyukov wrote:
> On Wed, Feb 3, 2021 at 2:37 PM Peter Zijlstra <peterz@infradead.org> wrote:

> > 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

Oh, making code to do it isn't the problem. The problem stems from the
fact that perf is supposed to be observant only. The exception is when
you monitor yourself, in that case you can send signals to yourself,
because you know what you're doing (supposedly ;-).

But if you go send signals to the task you're monitoring, you're
actually changing their code-flow, you're an active participant instead
of an observer.

Also, they might not be able to handle the signal, in which case you're
not changing the program but terminating it entirely.

That's a big conceptual shift.

OTOH, we're using ptrace permission checks, and ptrace() can inject
signals just fine. But it's a fairly big departure from what perf set
out to be.

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