Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp280743rwo; Tue, 1 Aug 2023 17:10:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlEgII057iNw97vN8h+Vd+mJTbz7ZE2JCrLtlZ8EvE14RYDAJkeamCM5CWOUV93rEVfjQDJR X-Received: by 2002:a05:6a00:1795:b0:668:753a:b150 with SMTP id s21-20020a056a00179500b00668753ab150mr16426339pfg.21.1690935035087; Tue, 01 Aug 2023 17:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690935035; cv=none; d=google.com; s=arc-20160816; b=wYbPI1zCcxb13pVQMPelUe+BPxuXfMTctNKf+acaO9e5nuDNA9qaN4kYaeFtNdUi/s 3Bg/H1OA79Ak+aTV5Rv1T1ghT89aoIdC0Bc+M+FHpKuOWW2FArpkJrECVvM/fWz06q78 31LJS3h3JpN0vw4cbWxvIDGPAL4Pa4pDph4ZztdGh/ihysHZ9z/6kcjb8X7Zeo25ddCA ovPdfwIeVedicUdRNW6IDuDvnb7U/1JFlQiZKOCSiOjiSfNbxZSoxXIECGchVyKUpza8 8FdHMMOQ9bBsGnMzg8+njFMqXf59rhDofeIP3E3BowlTOrqWISbd+RODemNDZGggznWp 2FlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VwrhWFrL0STvLWQ/w2Am6pHectUZNMaxuCR7s7TmsPs=; fh=TBB1WXoPylRQlek7AtMx8QsvnJTGYgHyk4G6a9zhNPw=; b=X+xjpLQtEMh/ysIu6sNIXeGwNxCOUkKZnqDL7DB5quJjzqgOT8cHDyTDd14JMzISkf GZXd2Cr2ZsAa8XwQBoH4oDjiq2fh01zvrJt9mYwRNuivAylF7fhYwO/rub7rYoi163e3 fTABrET9l4rGMF2YTsNMHrkqA+TEs6UBcaGokuA4cSk6Op2eEngYyIvRgiGQ077NkiDi IVbyLcA9sKMy1n6KfIlSvN6utLF5017W0dFg5gv4VvZi4FQCdnSLKqrkmH24XH21VTpB njAD2gTTU2JmQPoI3xMRUsFLRKnj19ewu6qcWFpfn2OxMLuAhLr9S3MHMFC7k9tcsmMD Fzpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=BVZd6vuN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a6540cb000000b00543c8ad57f1si9873961pgp.67.2023.08.01.17.10.21; Tue, 01 Aug 2023 17:10:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=BVZd6vuN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229741AbjHAXol (ORCPT + 99 others); Tue, 1 Aug 2023 19:44:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjHAXoj (ORCPT ); Tue, 1 Aug 2023 19:44:39 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5652C1B1; Tue, 1 Aug 2023 16:44:38 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b74fa5e7d7so94579011fa.2; Tue, 01 Aug 2023 16:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690933476; x=1691538276; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VwrhWFrL0STvLWQ/w2Am6pHectUZNMaxuCR7s7TmsPs=; b=BVZd6vuNbd5uEEFwbFF8xxtnbvzhTqsFMkwqnapndb/x4MMANmKzVC87oRfVxKSdZ7 iWigSJ4l4baVJdsbp+zwwTmxyMxoWXzejvZ0v0r7C3TFCWb/zjz4O74nHi+RXSPs31Ch iriv142DyY8aLsvq8gPKFNQjLj1J75t3GvXyK+voPQVNeh6sD7WXfExRd4NkVBuH/peq FPUmJhah5QOHpaL2OZo6AQdnQc0BImoRhoE/j1eJIiRXqd5r1hYENB/jw1/0Q9dDVX+s yKrxgEl/hxcLvSQb4BVupC0DXr85if/LbuI4JFj0/6VJr2CLM/C/3f+/mi1i/ODyIQg5 UA+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690933476; x=1691538276; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VwrhWFrL0STvLWQ/w2Am6pHectUZNMaxuCR7s7TmsPs=; b=OI2nHNF4FGK3qTVBkRfwqJWAmmuceG9EtrvsuRExKrRq48coX4R6RSsCKgYp08OKnx BpIWHJZ8UDlVnbN+aCayelYqQ691NGI51uUVIJmQKGyku8cnH8+BuDJdHXfPUip5TGHi cBfE5NXqqtBx6S+tPzcQkmGw92ejg2V/4SlhBc7exORBBPS0tpKoi+XxPF+XrhCQwzta TAKulkLfeN0yGjUys6VpIz39pp9gDugHL5MzTkYuRzu98tMLLTo1V+qe8dMJOG1gGwZV LfYUEEau7gZ3pnp+McqSwibnvWtgqVCWkO1I8i1upOMk9ZlG41ACojjOz06FJyGus43d 1wBA== X-Gm-Message-State: ABy/qLZXx+jF4+7JS4bX4nZir0T0qVNhffdvuA9abLX3SPP1WoN2qhe3 YDIT4wAw//HEyzh/aVYSeCYAxXOsiHJEmB9SDbU= X-Received: by 2002:a2e:2e0c:0:b0:2b9:2e85:2f9b with SMTP id u12-20020a2e2e0c000000b002b92e852f9bmr3788105lju.2.1690933475988; Tue, 01 Aug 2023 16:44:35 -0700 (PDT) MIME-Version: 1.0 References: <169078860386.173706.3091034523220945605.stgit@devnote2> <169078863449.173706.2322042687021909241.stgit@devnote2> <20230801085724.9bb07d2c82e5b6c6a6606848@kernel.org> <20230802000228.158f1bd605e497351611739e@kernel.org> <20230801112036.0d4ee60d@gandalf.local.home> <20230801113240.4e625020@gandalf.local.home> <20230801190920.7a1abfd5@gandalf.local.home> In-Reply-To: <20230801190920.7a1abfd5@gandalf.local.home> From: Alexei Starovoitov Date: Tue, 1 Aug 2023 16:44:24 -0700 Message-ID: Subject: Re: [PATCH v4 3/9] bpf/btf: Add a function to search a member of a struct/union To: Steven Rostedt Cc: "Masami Hiramatsu (Google)" , linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Florent Revest , Peter Zijlstra , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 1, 2023 at 4:09=E2=80=AFPM Steven Rostedt = wrote> > Then I recommend that you give up using fprobes and just stick with kprob= es > as that's guaranteed to give you full pt_regs (at the overhead of doing > things like filing in flags and such). And currently for arm64, fprobes c= an > only work with ftrace_regs, without the full pt_regs. bpf doesn't attach to fprobes directly. That was never requested. But Jiri's work to support multi attach https://lore.kernel.org/bpf/20220316122419.933957-1-jolsa@kernel.org/ was a joint effort with Masami that relied on fprobe multi attach api. register_fprobe_ips() in particular, because the promise you guys give us that callback will get pt_regs as described in Documentation/trace/fprobe.rst. From bpf side we don't care that such pt_regs is 100% filled in or only partial as long as this pt_regs pointer is valid for perf_event_output and stack walking that consume pt_regs. I believe that was and still is the case for both x86 and arm64. The way I understood Masami's intent is to change that promise and fprobe callback will receive ftrace_regs that is incompatible with pt_regs and that's obviously bad. What you're suggesting "give up on using fprobe" is not up to us. We're not using them. We care about register_fprobe_ips() and what callback receives. Whatever internal changes to fprobe you're doing are ok as long as the callback receives valid pt_regs (even partially fille= d).