Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp254239pxb; Wed, 3 Feb 2021 04:56:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlAkRpvEWtYBTHRJOHlDV/YAeenZwD01JmqWKnQYKH6iWGs21yJfo7KSa/C4aX8urtR/dj X-Received: by 2002:aa7:c7d8:: with SMTP id o24mr2842129eds.328.1612357007083; Wed, 03 Feb 2021 04:56:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612357007; cv=none; d=google.com; s=arc-20160816; b=fc1ShyRu0gUT9XPs5a5M7XoDw73HxTHkgED99aEMyBBWz+BO4rwQX1g8zhEoAwfd4D Yg9hhpW+qhqlZgxbK+lLNWeXX9LJKZu9xEnHLDT9kpxTUB/DqFL/sA1Kz8FHnWFHY0NI JVy3WrlcYKXqrAKCrETwQfi0v67bp6j3JN9pJghxCoT7qI6dhoiR5oK61DIil7K6CgQI w5llgV6gbX3w5AiIjVTsvcDMevmJC9dJTpWR/RaSJUSxAfW5pFR7YTZHSZJWWcy5xLMx CwK7+iKfdlH4N06g1T6lfREs3P6Pn9XEL2+lwQaIY3CbYWo466jh5HlqzGMFWKT0+UvT p3Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TFcUxsWT13RfOOl0Dl1xGflYYj3iUd31njtwj2FIiLU=; b=YJQ+Mr22mNdtugkvhSCAKOs1tG+psUfk+9ru0KOIL6UFYBQF2M+qaUiOTsK05r/SK8 RXDP42Xy3+fCQyjkTvCyOIrr5n1ndalrJkHv7SCw1bmvkJg2zQFU3P5Es8/OD+j2imAE Gp0eDVq95rZgdO3vc5TeC9a9HUGxEbnqpL52x7/P4wwWQqoyZOko33L3Gg9gllXQz5d1 CVx1gjv8Ad9GNYa80On6QTuKSLGThr72ZtwHyOBjwN16kgHLPpY9Rb3zDytD/XcCLD3I 1yQVFATQxqXiuaFh8NwCAd874STO1gHhNyKn9j79qtn0tI0SOgD7mRQ1X+h80Dlhzs9s GYrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vzPuoTyM; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 16si1063465edw.253.2021.02.03.04.56.23; Wed, 03 Feb 2021 04:56:47 -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=@google.com header.s=20161025 header.b=vzPuoTyM; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231429AbhBCMxY (ORCPT + 99 others); Wed, 3 Feb 2021 07:53:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231184AbhBCMuu (ORCPT ); Wed, 3 Feb 2021 07:50:50 -0500 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CED09C0613ED for ; Wed, 3 Feb 2021 04:50:09 -0800 (PST) Received: by mail-qt1-x830.google.com with SMTP id w20so15181255qta.0 for ; Wed, 03 Feb 2021 04:50:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TFcUxsWT13RfOOl0Dl1xGflYYj3iUd31njtwj2FIiLU=; b=vzPuoTyM/I85E8YbIRlYLoFi5fGJXki/iFdZ+oEYLsFfwIb3N+prYTAZ5x5hS5PnPl Bz61vYPfdKfayJ7U2ICR+EVec2fOG7OW1Yzzy2N5aYJUrOp0fu37Q8d6IE7XwhfhQqZ4 gXp4XTfAbEP1bkBEho4tsr6ywFIJ4XyOUFhqlhL5/KUM/6aIW/WVt5V1cZRIQ/mouxCR MVqgopw0qJwHbytAU1fLbqQOQLJYEk/+8oqnlbrnRxjkcvLEk666QRWYYK4EEvnPNDvo 3zjBTrBHta3rtO7ndFSHoGOohX1vg3MKdr3YDpSlrMeNK/M3U4efi64d052EPSPp7HuR jpoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TFcUxsWT13RfOOl0Dl1xGflYYj3iUd31njtwj2FIiLU=; b=C5dV70AkpYzsLhwvbu5TX9CA4KRRqSTqWTP2e1O85WtyrwYHm2DC7DJ/dMn87XW8iE aPmW7wek3us3nudYzuPkqA1i7idOlLKk+bpVId3SAxt0WMdB7m6E5eNpScMQGRjuguW5 gvIOhU/xWUq2NnWnbFx9sGNmx6ZQqTVAxEGbICGmh3WYIBeUuA9figvs1xi9ZHUgA+Kq B+PVmIwGSFa1FnfbisK/16dy3I0unebHn22VDKNe1uF+Pf+ZRIjZgTmwbIONZM/mG0BW VJL0RZaOE7PKVruau2sj7t3PEWZQvD2ZiJGqahO0kNv1YATlz19CoP46K6q4aWdNy9jL vyow== X-Gm-Message-State: AOAM531bOKYIthdTQzlIQVFB/QvP/pstqc3mdyBbl/xrFpJtVJZtdClj HiSBI366UL1RijPu8c7RB4feeITS1NprWwQ7XoVQcw== X-Received: by 2002:ac8:e0e:: with SMTP id a14mr2270669qti.66.1612356608469; Wed, 03 Feb 2021 04:50:08 -0800 (PST) MIME-Version: 1.0 References: <20201112103125.GV2628@hirez.programming.kicks-ass.net> In-Reply-To: From: Dmitry Vyukov Date: Wed, 3 Feb 2021 13:49:56 +0100 Message-ID: Subject: Re: Process-wide watchpoints To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Will Deacon , LKML , Matt Morehouse Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.