Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp239810pxb; Wed, 3 Feb 2021 04:31:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/cha0ZxRYLdOztrEHiTMRRalda4XAXI51m7c9GVkSjZPz16i/bYrg2OQo+eo4MkIhzkaP X-Received: by 2002:a17:907:968f:: with SMTP id hd15mr3050276ejc.440.1612355511851; Wed, 03 Feb 2021 04:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612355511; cv=none; d=google.com; s=arc-20160816; b=CHivzJIQqbGIk6sDwZJPaBuA20yE8EoWAvoEM17F44IQws3N4n94LWHMCYMSTajOMs NtWrtsgBmbfQXgxxEp30cEsY3IVDrt6IzSVpd608FXCZoebeMh416tJiq9O6cJTbE67E wClPJCrEs0jzU5Ydviflyu63LE6ym9tXl0vM43ihA+ddg6usk8Pb3H4Yfdl36RWvLpN+ cx3OSaepDaKkzfMij6bZuL2vO3Klii0ovtpKH5eiMpaqVuU6h4nMAK9aK586xue51e0W gn7Ele4R16wbUPidxcu4Lhflq5iOHrLwKbIpvjwmpdteQhcVuG+c6B1exbE27p+HDrGf sHUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0whPSGFN1CVL6QUNOgyRMN72vs82UCOXVmcMiQnW0mY=; b=lbCONQpbvE3wVKzXv0y41azqgxLc2TP3s0HF2O7leFqFjmRLEhpKPSFH5x92f6Eg2z H0PaiKypauIg0xxlksUhaASd96Eh2/38u3RapcAn1wZWDeFzXZcCE6MRUmFYF1/Isjti WOiCyt0i1lSiIsrekty5lE50cyPYyN6+1MZwBPFCIKyE3S9xIqoOq/Sgh7hdZ/leXK52 yVoofVsP1vB55k9vQRtw6bDS47dZbJzk34nl2Oseq1AmA2rUvE1VG8xU73Z7dogWYfSa 2BYU9ljM6d9yiX7JltWi0FGT06kTQKnSDNSY4/0FZrvcq/9rnnPuvMfCcUM8n5jTY08f LcVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KsJHH3Vo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si1174559ejc.517.2021.02.03.04.31.23; Wed, 03 Feb 2021 04:31:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KsJHH3Vo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234274AbhBCMar (ORCPT + 99 others); Wed, 3 Feb 2021 07:30:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232525AbhBCMap (ORCPT ); Wed, 3 Feb 2021 07:30:45 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 811B2C061573 for ; Wed, 3 Feb 2021 04:30:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0whPSGFN1CVL6QUNOgyRMN72vs82UCOXVmcMiQnW0mY=; b=KsJHH3VoRB7/HwwSj2rVkY+K8w IzQDXGLucXhRN7IcT7oY8qR7wEJ0+APhXypzcZth0nvGcASOCFCDYzGU5yo4MTlpH4e6Ts6I9zch8 zBHnk4GKQrFECeJNnjxwoINuPKcZ40z4DIFlx7l2OZVasA8zfHT8XgYUhs7/OM+EIfsPeZQQLXKnX Mb8tKrElPS61aBuA63c/5xOBHD3yF8bObwrlsphimQZkvYTa+UgxWSchVff//gVa3gbER8cQTFDPZ gmdcpKNlUGQw8DgbUQkrcIZOXUzFe6RkWRzdeVR6VRgcdGr4jfTAeuse2ZzxGZ+5x8PeFKqbgPabF pXBj+3Zg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l7HI7-00Gplz-4o; Wed, 03 Feb 2021 12:29:51 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 44042301179; Wed, 3 Feb 2021 13:29:50 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 261922BD45B6A; Wed, 3 Feb 2021 13:29:50 +0100 (CET) Date: Wed, 3 Feb 2021 13:29:50 +0100 From: Peter Zijlstra To: Dmitry Vyukov Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Will Deacon , LKML , Matt Morehouse Subject: Re: Process-wide watchpoints Message-ID: References: <20201112103125.GV2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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).