Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp284290pxb; Wed, 3 Feb 2021 05:40:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/ugTCFFMWcNpjcJ33u45uYSQYdYAdYUdgiuc8AGD0vtOXndzqkliDhVrfA3ptDoWhlgcQ X-Received: by 2002:a05:6402:1ad1:: with SMTP id ba17mr3019077edb.243.1612359653627; Wed, 03 Feb 2021 05:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612359653; cv=none; d=google.com; s=arc-20160816; b=MN2j2m4QLGATntbOldloF6QXfQUrEKhsWqrjaw2/1Hz2YG1qnAqPTGMbXuXxz/vwyN 7/pcY2JKlmZSs0/9N8TBvJBHlxbKCqQDkMArdLtDLR/PcCWu+/+/GIM5ljkeWWD8esnC qUR2sL/WOJUtkOnpoPTTT49fq7phC/1h3qmLJ8U4jO0HdLZqyzb2S1BD636siABkilTu xJZRbi+WK/Ee0cy6Pr6hEcuGlU7TwGyCvD2U5kk3akMciJH5Oo8cvdgzxZWpo3UJctjO wb92oxwb8OvFq8IZ1/4Eub/eNc8EUKYFcMHfUx3zyUxKtqLoV+y/EfYwmg8fLzNbdxjx zFBg== 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=r0k7fkjKZZ1/Vt6lQr+Rtmn6WL7bhCFvwGKVqtcNWZ0=; b=qujOcpfmTP5tkdBB+znmMlHMLLcTnUSiL8ldNjuogOtpqMAgIVQ4Y4yk3dEUgViEEC nUyGjxq5RwF6TumTlc7s1oVSBhdXwSVQRiKBk6sgi7KFBwF7JphINvBBFPpgK/pNB9jj wP5VsWvopxfqAnEkT8LCPLA7Dbw58010b8Om2E737dvrgyzEsU17LlffpeCw7YxffmUr /92IGKr1ZfX8DWseg6Ma4tV4E2UREH3uXVsoCspVUwyxLXhbGrIN7hPPmVpVpYlxyKLi WC2Z3wMxkdlX5H+BPpLvoeq9x4oxjARDLir2Qlt0gUNEQH1wQE1n5FKOS3W+LDbjRXpM AsTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=JD4ERjBl; 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 h5si1410382edd.237.2021.02.03.05.40.28; Wed, 03 Feb 2021 05:40:53 -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=merlin.20170209 header.b=JD4ERjBl; 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 S230315AbhBCNit (ORCPT + 99 others); Wed, 3 Feb 2021 08:38:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232081AbhBCNh6 (ORCPT ); Wed, 3 Feb 2021 08:37:58 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E43FC061573 for ; Wed, 3 Feb 2021 05:37:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=r0k7fkjKZZ1/Vt6lQr+Rtmn6WL7bhCFvwGKVqtcNWZ0=; b=JD4ERjBlcjJ0TYq7tXpsomdani m3trTAmxAW1JhLlxvNlVazdX9jfnK7BFy/BrxHFqppV4znvS5JKIil7IvkhEcVoDJd1kulkjMafSi idCh//S4tVV/8De/4BJ0TPVs2QHp3zD80eKg2OklccCJoUdeRjWO2QhIarz+I8QEKOn/nmlA+/WVk Tt0AuEgWfI5/L6nhS65dgYioST8kCM5wJ7JCpwYd1MPTHdETPTnIz2dooFElJew0Ty+S7KTZt7RF3 bxXi+/Cikx7vaOOLDaZHMjQ6VWLtZbgvv/NYMgzyz5HTIRWbl21Pdxhcs/4MgR6IOH4oJs123I52S oiUdUc/A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7ILF-0005GU-9t; Wed, 03 Feb 2021 13:37:09 +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 6034C301A66; Wed, 3 Feb 2021 14:37:05 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 49125284AA052; Wed, 3 Feb 2021 14:37:05 +0100 (CET) Date: Wed, 3 Feb 2021 14:37:05 +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 Wed, Feb 03, 2021 at 01:49:56PM +0100, Dmitry Vyukov wrote: > On Wed, Feb 3, 2021 at 1:29 PM Peter Zijlstra 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.