From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 317F6C433DB for ; Wed, 3 Feb 2021 12:54:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A57364F7E for ; Wed, 3 Feb 2021 12:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbhBCMy3 (ORCPT ); Wed, 3 Feb 2021 07:54:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbhBCMvp (ORCPT ); Wed, 3 Feb 2021 07:51:45 -0500 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30802C0613D6 for ; Wed, 3 Feb 2021 04:51:04 -0800 (PST) Received: by mail-qv1-xf33.google.com with SMTP id w11so11527596qvz.12 for ; Wed, 03 Feb 2021 04:51:04 -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=urlXgvdHZ7AdoyDi5Tr/sMAUoN/vP9RgT+B6nvRJ2zE=; b=Yn2txxbXodlxuZAbDxuOGWoA9dwl42M7uI4+u06CUV9jEufxCRzyG/2wTAw7NbOw52 a7/SLoD/I47mklXdOnehEN2fcHzNzp8G8tCZXEC0OYGsxGschUFxCCFrBKuuL3WTZZI2 bLzcHyvD82VDjZp1lu439Ig9FhYQU4MXpadbr7KdlnOP5S6qbAhx649sWiOPlvoBxcM6 BoKxlrSQV4/n2qLKF5e/Q6TjSJqH5SIFIj1FgsUWC+vdkchJPzskF2vjSulhnJhqvK0q cjgiM/EQvRpxG7PIL+xphAYqzZantmHh0qj7DBRGsspgXuDo6kuwhGUl4Tpqwlg5ZCk6 LxTQ== 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=urlXgvdHZ7AdoyDi5Tr/sMAUoN/vP9RgT+B6nvRJ2zE=; b=TpkKdKE3ScgKI2isU9DAMAtGN8H2KRsysRomTR+Ez7wV3hNA4wJ9WnIYGsdTFVwH9C 5u2Gw7gWPwb4GfwnmrC0Slf2gSF8S/BBLBIDDvDiUnHkxRdCI2obDWx6lKbvBoQp+wjb D1Q0Nwde0+X0yxGK1ftHcuTPxKLcPBMJ9kPr4c+Itqiz+OtAsKE1+VcxYxAY3PKf/euL UZNQ+8Guv6eStNXhgtxFkVGU1qrq0wbvtCNfHW8+UgoZOdE70N5BtFuVovbWo5Pzgz4Z 4pWpqh8a3x/SGtMjXtM0RtzpH+xMHx10LSeTHEd10JbpIAzRGVjEvFHU9xs6/gXwZJgA wy/Q== X-Gm-Message-State: AOAM530MYsVbIFKGEFR/qYFz+G5+cp2JH5zLvHAAGfVsvLcZAHIFC3zc 0wHWKRbJacLtqX0k3+U6TuEvQU3rDUECbGR7wbNa3w== X-Google-Smtp-Source: ABdhPJw/PUxPdFP/SwekX/g9mATpsTLw6/Hq/gtawCPPqLL5eLqwbxTmUnop3wu6ToCNY3AhCpfvcY0xs1+jnmLJljo= X-Received: by 2002:a0c:ab16:: with SMTP id h22mr2578667qvb.44.1612356663133; Wed, 03 Feb 2021 04:51:03 -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:50:51 +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:49 PM 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. I think that signal also does not carry the address and other info typically present in SIGTRAP/SIGSEGV.