Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp331866rwo; Tue, 1 Aug 2023 18:16:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlHdTtYpAFqyqbQp8vAKo23++L2sC1BM1zGTmWXAsRgz4me84yQLPP0aKjQMoao6CwW53jJL X-Received: by 2002:a17:90a:dc0f:b0:268:7d8:597d with SMTP id i15-20020a17090adc0f00b0026807d8597dmr13053403pjv.46.1690938974651; Tue, 01 Aug 2023 18:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690938974; cv=none; d=google.com; s=arc-20160816; b=DPqNGMYu70c0nYVm6DcaY/1nrLlrvFm3BgHQ+IxNPo8nF7yM7h1Pp/zit+rDVQ/2F+ oSquBVC+GZoN6lvDybN5mTfVRGrY47+bR70geaLF58BxoM23sms1O0SB8+ldClVk5sGh 3K4GGQ2clJimmBc4M/ZZQM2LETvTnS9NH2TkpdLEow299M1RhD/euMC8EVIC34zdPjDJ RgRs+Om81OKleIKondEGO64qEREXBT/3qzELivHyEPRLCGQxgA2Mn0dAiJ/7R0wJW5yj KnZeA0s6VqRRV3YAka7cfh33wCwhtVhAk5T+t3ooHNYpS6pW/SQpxjptevN4tjnqglHg dSKQ== 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=JTAMEGR1dMpo1RcXFwVXc0ZdDqdu7mLFbtcnsS1mOvo=; fh=njggT44Yx07VTurUmZPytuvuieD3ljjDCamzGarRmg8=; b=Wa3AVC26UHI14llyMJF27lkp++4WT2lajHPIooGjMHE25ELlWy8yY/CK69y9noECGN /0BtCS6OQAIqhQNE8aqH2mmeQrXN7lR1sA5DK0E2E4yXrv1zUt2fojOY0Qbim6lve358 tNYPI/rpJ6PYvmjx2HGffVpHW1aftefHBOBFb31HU/3H+mfHofe2sxzpSkuJjnrokqRf VVJnO+RGW2ORJZB5mdkhTNzdOWz8o6svM1F5kXMOxamJk2kKaRKWtQ74EoVSb1CR+nL3 XmiRP2utU7L3Sy6qdJkDd5pbJ8JRRiJuCxF8fqShgqNKu50juOLL6ri7OGbfhl+13PbB 4rtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=BQ5mn6aE; 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 cx10-20020a17090afd8a00b002636242aba6si273478pjb.21.2023.08.01.18.16.01; Tue, 01 Aug 2023 18:16:14 -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=BQ5mn6aE; 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 S232782AbjHAWTO (ORCPT + 99 others); Tue, 1 Aug 2023 18:19:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231301AbjHAWTL (ORCPT ); Tue, 1 Aug 2023 18:19:11 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BD2719BE; Tue, 1 Aug 2023 15:19:10 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2b9c66e2e36so3570841fa.1; Tue, 01 Aug 2023 15:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690928348; x=1691533148; 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=JTAMEGR1dMpo1RcXFwVXc0ZdDqdu7mLFbtcnsS1mOvo=; b=BQ5mn6aE4p8kMPhYMcGlf6MKuupZ/deXnrjxgXW6aZ8uPO2X/qqFxv66c0YDdKbR7D trhgVhnWLEpXSLu25uPPyCn0oBJZ7vXG0/Bo/9cAbRQPArVK/Ykwhcix5SjNA5gaPOtn VUm6EWBnlUoZSc/z9aZwoeoVdQqRKhFsAOo+8mOR8GvzdOHdWA1yY/rg01AU7juBJVfv pyvgxeIbLRjo3yUfD//X5W3B98p5h8TyFwiAbjGzfr7dtA0KIdFTbDQBclX3RipYOjcB h8Y1jzm/I9DLD+DifdO9pkjb+fJw1c59mrj9gcfi7o09LfQO5NDHdVx+KNyWKqyGR8O9 ulgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690928348; x=1691533148; 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=JTAMEGR1dMpo1RcXFwVXc0ZdDqdu7mLFbtcnsS1mOvo=; b=SoyiaUnp7cmYw+axJu9dgSV72AXejrPaXWnZkhYMFros15P+dasQRLHJ4XCRusoaR7 anMcddK/5Nx+YgebDRv3plMfdl7hiiFvuAIQQA4rHC4jwWY/c1GmHb8mgcJq3DgdNA4g Tz6trNGekRSlT+grY4vhdAYKKfev6caTQyN3pV4jaUT9gf2BKRIraRMWKZxcfNpQY7xr J23q4r/no3fDXyNbTqFhlh5cxsbd+tpF40OLmjVngCa5yWs3ap9dBv17lo/jEzLvbwid 6R0JGb4cJ0kSi9sFxM25k5mFjWXi3KPxACt3VWwF6o9WUI8EiR00w2i1mesYnlJgVYTd UbKA== X-Gm-Message-State: ABy/qLYLTchMoMSsfscB+72a8M3yPoMO1pwFUN5sTsSadR3WfHNXb0VR uhibbUFzsvcMMeeky/yPkeTN1Kr+K+YFXryrS6wT0Bf9VfI= X-Received: by 2002:a05:651c:3d9:b0:2b9:d965:fbf2 with SMTP id f25-20020a05651c03d900b002b9d965fbf2mr1344478ljp.22.1690928348104; Tue, 01 Aug 2023 15:19:08 -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> In-Reply-To: <20230801113240.4e625020@gandalf.local.home> From: Alexei Starovoitov Date: Tue, 1 Aug 2023 15:18:56 -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 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 8:32=E2=80=AFAM Steven Rostedt = wrote: > > On Tue, 1 Aug 2023 11:20:36 -0400 > Steven Rostedt wrote: > > > The solution was to come up with ftrace_regs, which just means it has a= ll > > the registers to extract the arguments of a function and nothing more. = Most > > This isn't 100% true. The ftrace_regs may hold a fully filled pt_regs. As > the FTRACE_WITH_REGS callbacks still get passed a ftrace_regs pointer. Th= ey > will do: > > void callback(..., struct ftrace_regs *fregs) { > struct pt_regs *regs =3D ftrace_get_regs(fregs); > > > Where ftrace_get_regs() will return the pt_regs only if it is fully fille= d. > If it is not, then it returns NULL. This was what the x86 maintainers > agreed with. arch/arm64/include/asm/ftrace.h:#define arch_ftrace_get_regs(regs) NULL Ouch. That's very bad. We care a lot about bpf running well on arm64. If you guys decide to convert fprobe to ftrace_regs please make it depend on kconfig or something. bpf side needs full pt_regs. It's not about access to args. pt_regs is passed from bpf prog further into all kinds of perf event functions including stack walking. I think ORC unwinder might depend on availability of all registers. Other perf helpers might need it too. Like perf_event_output. bpf progs need to access arguments, no doubt about that. If ftrace_regs have them exactly in the same offsets as in pt_regs that might work transparently for bpf progs, but, I'm afraid, it's not the case on all archs. So we need full pt_regs to make sure all paths are still working. Adding Jiri and others.