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=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 3ACC3C433E0 for ; Thu, 25 Mar 2021 15:36:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC81261A2F for ; Thu, 25 Mar 2021 15:36:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231401AbhCYPfy (ORCPT ); Thu, 25 Mar 2021 11:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbhCYPfp (ORCPT ); Thu, 25 Mar 2021 11:35:45 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E06C06174A; Thu, 25 Mar 2021 08:35:43 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id bf3so2904075edb.6; Thu, 25 Mar 2021 08:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1QKElLhOfCduB4W2ZnttsXzaaUpOx3i5hzbEvc+SfaM=; b=vReFbpzUBBXDyQUErdI0nstv8yW0OW75oySEvy3/KYNqcwbs8aHjOCdxuz7BaMFh3U UF+583vXaR5SNWYyaebRJ2npbrVh4f2FBE1HP0gXRRziMzcAxQynTX0+I2M9YnqKNMv2 wRcELASUKOjdxmiAuBnjEVzm7bveC8y1SyLfBrk+qwaVMRND4BEMUzyEQzO/cN2B+o5v Lvn9XVEv4yi4jKI6S4bCugs0E5kJRol1NWonhvNfY6RtQUcjmB0Src2XvhzgK+ykZap2 KZCpV61fJAt2PEtl/i0j7ck/e7Vf8BtUOVN3JYzbOrIKyAcfRWVqlbnzW+lN8MpQx1KC fwxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=1QKElLhOfCduB4W2ZnttsXzaaUpOx3i5hzbEvc+SfaM=; b=joQIGIrEqsUVi5PDEy4oK5TwU0zjCrox19klHdc1oDwxks4zR8JvGqAALkCX28sB3e U8fgZ775tc91X1piKQ1/BRZjtzBQ5GfrHz9k2xGISNgGeYwzs6Olx+5RScJJh/a5BqEw uPT8zDBjPYLuFVoqNNNLyTUJglyp3xj3jtDPdzOU6De2EZjwTQpO7G95ons8uKegLsEg ZRukiBReMmb9RV7kEvWE4xHyxAM2WUD/pOzhFiX4mcVogv31McAVaom2gomKCPC7uQt1 avpZd7L5VSBPZzzTblAtbD3MHCARu5VfA93VBU+EqR5n2S41pLS2Jfmgd9Rs1JjIRg6k +bcw== X-Gm-Message-State: AOAM5313PSgRQs8Qd6WASB8Vv4sbg9+WCh4wsV3FZya5FxaoL5FcKZTW tb8re6F8ZLD+7j5VutaBff4= X-Google-Smtp-Source: ABdhPJy/1eWCFTCJH7El48i7bPgctwSRVRauBoblIf5Y4tbBowf/F2Xp7Kn8apN23vTJwgVJ8ljFTg== X-Received: by 2002:a05:6402:17d5:: with SMTP id s21mr9755769edy.65.1616686542501; Thu, 25 Mar 2021 08:35:42 -0700 (PDT) Received: from gmail.com (54033286.catv.pool.telekom.hu. [84.3.50.134]) by smtp.gmail.com with ESMTPSA id r19sm2868681edp.52.2021.03.25.08.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 08:35:41 -0700 (PDT) Sender: Ingo Molnar Date: Thu, 25 Mar 2021 16:35:33 +0100 From: Ingo Molnar To: Marco Elver Cc: Dmitry Vyukov , Peter Zijlstra , Alexander Shishkin , Arnaldo Carvalho de Melo , Ingo Molnar , Jiri Olsa , Mark Rutland , Namhyung Kim , Thomas Gleixner , Alexander Potapenko , Al Viro , Arnd Bergmann , Christian Brauner , Jann Horn , Jens Axboe , Matt Morehouse , Peter Collingbourne , Ian Rogers , kasan-dev , linux-arch , linux-fsdevel , LKML , the arch/x86 maintainers , "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on SIGTRAP Message-ID: <20210325153056.GA1895212@gmail.com> References: <20210324112503.623833-8-elver@google.com> <20210325141820.GA1456211@gmail.com> 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-fsdevel@vger.kernel.org * Marco Elver wrote: > > Yeah, so why cannot we allocate enough space from the signal > > handler user-space stack and put the attr there, and point to it > > from sig_info? > > > > The idea would be to create a stable, per-signal snapshot of > > whatever the perf_attr state is at the moment the event happens > > and the signal is generated - which is roughly what user-space > > wants, right? > > I certainly couldn't say how feasible this is. Is there > infrastructure in place to do this? Or do we have to introduce > support for stashing things on the signal stack? > > From what we can tell, the most flexible option though appears to be > just some user settable opaque data in perf_event_attr, that is > copied to siginfo. It'd allow user space to store a pointer or a > hash/key, or just encode the relevant information it wants; but > could also go further, and add information beyond perf_event_attr, > such as things like a signal receiver filter (e.g. task ID or set of > threads which should process the signal etc.). > > So if there's no strong objection to the additional field in > perf_event_attr, I think it'll give us the simplest and most > flexible option. Sounds good to me - it's also probably measurably faster than copying the not-so-small-anymore perf_attr structure. Thanks, Ingo