Re: Process-wide watchpoints

From: Peter Zijlstra
Date: Wed Feb 03 2021 - 07:31:06 EST


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