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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14588C04A6A for ; Wed, 2 Aug 2023 14:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234506AbjHBOtN (ORCPT ); Wed, 2 Aug 2023 10:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234305AbjHBOtI (ORCPT ); Wed, 2 Aug 2023 10:49:08 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B23B02D52 for ; Wed, 2 Aug 2023 07:49:05 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-54290603887so4322853a12.1 for ; Wed, 02 Aug 2023 07:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690987745; x=1691592545; 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=1rRKUOEKn1QH1pife42dl+oAyUZxrskG/HFrJzSInDA=; b=DpYN5MG0pzSiAPLsEzoV8eOmMSH1CDuQ7vDHg5gc6jCKcVT0S7RrTmS8bmzOo/Or5c HEsw+RoC6s78YHnus1bYyA8SSwEuq57QW5wFSaLNzgEEy/1B+byNTXYP3uiyDEP3UoyG pBzpm1YwDzfWWjOcNKiHqpDzbdmL2Hl4q0wMA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690987745; x=1691592545; 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=1rRKUOEKn1QH1pife42dl+oAyUZxrskG/HFrJzSInDA=; b=L6xcmAucvCNcTCtnlod7sfnwugJ/3FXLaNKV86iPdFLoBWozgBvvUQ14oChSUiDkrV 1tTsSXWo9ICWWHl+oS7FKLkXpnWLpOnIl4XHVHYlZismTevjqyFLJ9QTm9M+Mnj29wIu oUrCSJfOovih7mz5hqvdZp3Jga2Yaz2toWPfh1qeu6TMCOeOKqxNeo64t1hwahiGY5I5 ctF8GkXXS7dEksX8lKuiA5kH1qniQqey04t/GaktbfzBdjlug7LAgnh2CbE3RoiHpNCO K70ZT6U8lKBaW2/KAoxpEAn7pk75dDJL+hyBvrehYmI3aRSjy0FE+3CHGr8XXQ8aTznD fO2w== X-Gm-Message-State: ABy/qLb4BbbFMhMsZzNovRdV2HYvxPuakmHkMbV0N2d3dXTVTELPAgPc zMqXpHU/jdmgwetpedfoYuv64IbzzQN1xg+9J9fROw== X-Google-Smtp-Source: APBJJlHF04dNCJtjHcj6eeAys3uZls91rhQLt0HULf+PZKIecfP1ICaH1OKZG7EDqEOkjEduKPKqOMNRvGF6NKzCaA0= X-Received: by 2002:a17:90a:5ae3:b0:262:e742:f419 with SMTP id n90-20020a17090a5ae300b00262e742f419mr14639445pji.47.1690987745147; Wed, 02 Aug 2023 07:49:05 -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> <20230802092146.9bda5e49528e6988ab97899c@kernel.org> <20230801204054.3884688e@rorschach.local.home> <20230802225634.f520080cd9de759d687a2b0a@kernel.org> In-Reply-To: <20230802225634.f520080cd9de759d687a2b0a@kernel.org> From: Florent Revest Date: Wed, 2 Aug 2023 16:48:53 +0200 Message-ID: Subject: Re: [PATCH v4 3/9] bpf/btf: Add a function to search a member of a struct/union To: Masami Hiramatsu Cc: Steven Rostedt , Alexei Starovoitov , 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 , Peter Zijlstra , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org On Wed, Aug 2, 2023 at 3:56=E2=80=AFPM Masami Hiramatsu wrote: > > On Tue, 1 Aug 2023 20:40:54 -0400 > Steven Rostedt wrote: > > > On Wed, 2 Aug 2023 09:21:46 +0900 > > Masami Hiramatsu (Google) wrote: > > > > > > Then use kprobes. When I asked Masami what the difference between f= probes > > > > and kprobes was, he told me that it would be that it would no longe= r rely > > > > on the slower FTRACE_WITH_REGS. But currently, it still does. > > > > > > kprobes needs to keep using pt_regs because software-breakpoint excep= tion > > > handler gets that. And fprobe is used for bpf multi-kprobe interface, > > > but I think it can be optional. > > > > > > So until user-land tool supports the ftrace_regs, you can just disabl= e > > > using fprobes if CONFIG_DYNAMIC_FTRACE_WITH_REGS=3Dn > > > > I'm confused. I asked about the difference between kprobes on ftrace > > and fprobes, and you said it was to get rid of the requirement of > > FTRACE_WITH_REGS. > > > > https://lore.kernel.org/all/20230120205535.98998636329ca4d5f8325bc3@ke= rnel.org/ > > Yes, it is for enabling fprobe (and fprobe-event) on more architectures. > I don't think it's possible to change everything at once. So, it will be > changed step by step. At the first step, I will replace pt_regs with > ftrace_regs, and make bpf_trace.c and fprobe_event depends on > FTRACE_WITH_REGS. Just a small note that, strictly speaking, CONFIG_DYNAMIC_FTRACE_WITH_REGS=3Dy is not enough. fprobe_init() would also need a way to set FTRACE_OPS_FL_SAVE_REGS conditionally. (you could be on an arch that supports saving either regs or args and if you don't set FTRACE_OPS_FL_SAVE_REGS you'd go through the args trampoline and get a ftrace_regs that doesn't hold a pt_regs)