Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1447704iob; Fri, 29 Apr 2022 05:39:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCyDbvgpIPVFNp4iryyArJdrharwFsXrUNvsGzoHn81sMtfGKt+h0y56n+0T+TuJJ8Jtdi X-Received: by 2002:a63:91c4:0:b0:3ab:1a43:cd1e with SMTP id l187-20020a6391c4000000b003ab1a43cd1emr24530464pge.540.1651235957494; Fri, 29 Apr 2022 05:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651235957; cv=none; d=google.com; s=arc-20160816; b=X+nt6Eb6Z2GCYm4yxC7eeA1DnrOlAguwTgaTsLwltJweIjE2KLDVgyCDXNNwO+/1mu Sm50yqk6n/rE6dUDwm+0lU4sxzf6Do8gn4ZMdgfRksW5ym8Uekxkf/7GjtCtyxgoocMZ VqMk6A3dKD64Jf2RUuyRO237bmzdJyu/pOSaksn1LsP9556E8dNtMkZApLjiJDieZNxe hH+zZ2zOJIfc1ARZxtFdwfAQEdsdrk8m90cPRWRe1pW3uM6m5kTjrWrLJu7NFmiK3Uj+ 1mSlAeC3t87ED/BkY141tMCHHAO9ND1mbEc/lq7Bx8Ro4cCjlw4jwj/M+A1TBRnTDn6b xASA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=6FSHFWtESMmrULfkubIkhbCpf4hovk9EzwjjzhWtkhI=; b=BNCb7k2xKeGfnpno9uOppqv/JGELl5KJNjPmTs5Yx+Ovck0IZ+cQVLicjw9ZdQ+JI0 7mRYAPro6ZYOEU+1XQnkd+xtccXNXorICL3GT4Ro3nLdHRCcZzfib8GtVjI36RfrwS1R /2NeEaOv0HeXlVBEZZxvsLzQsTEUi0uMKyP4YAUQIsdG5g5H6+/e198c+R9TgmdFPoS2 w6KTatC0p9dYL7v2stPF6JNdSyIb8MQ0oYbp/kt2/5tGabC22R/3HlAo2CBDEo1Xktu8 xOqOdBC+O8GMhGmIOplqjBDB3TMQL3W+tg6PTIuLBnoLftUYciUPou3TOwA3s/RURxBk 8KcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q37-20020a17090a1b2800b001cba2446e7bsi10615725pjq.66.2022.04.29.05.39.02; Fri, 29 Apr 2022 05:39:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353504AbiD2ANL (ORCPT + 99 others); Thu, 28 Apr 2022 20:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbiD2ANJ (ORCPT ); Thu, 28 Apr 2022 20:13:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69F5E7561F; Thu, 28 Apr 2022 17:09:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 29B02B8327D; Fri, 29 Apr 2022 00:09:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55FFEC385A9; Fri, 29 Apr 2022 00:09:47 +0000 (UTC) Date: Thu, 28 Apr 2022 20:09:45 -0400 From: Steven Rostedt To: Andrii Nakryiko Cc: Alexei Starovoitov , Masami Hiramatsu , Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Networking , bpf , lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh Subject: Re: [RFC bpf-next 4/4] selftests/bpf: Add attach bench test Message-ID: <20220428200945.5f6a5ba2@gandalf.local.home> In-Reply-To: <20220428195303.6295e90b@gandalf.local.home> References: <20220407125224.310255-1-jolsa@kernel.org> <20220407125224.310255-5-jolsa@kernel.org> <20220412094923.0abe90955e5db486b7bca279@kernel.org> <20220416232103.c0b241c2ec7f2b3b985a2f99@kernel.org> <20220428095803.66c17c32@gandalf.local.home> <20220428160519.04cc40c0@gandalf.local.home> <20220428195303.6295e90b@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 Thu, 28 Apr 2022 19:53:03 -0400 Steven Rostedt wrote: > > But that __fentry__ call is not part of __bpf_tramp_exit, actually. > > Whether to call it a bug or limitation is secondary. It marks > > __bpf_tramp_exit as attachable through kprobe/ftrace while it really > > isn't. > > I'm confused by what you mean by "marks __bpf_tramp_exit as attachable"? > What does? Where does it get that information? Does it read > available_filter_functions? OK, I think I see the issue you have. Because the functions shown in available_filter_functions which uses the simple "%ps" to show the function name: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/ftrace.c#n3692 And the code that does the actual matching uses kallsyms_lookup() https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/ftrace.c#n4017 Which appears not to match the function for the address, you can't pass in __bpf_tramp_exit because it wont match the symbol returned by kallsyms_lookup. This does indeed look like a bug in %ps. But in the mean time, I could open code %ps and see if that fixes it. I'll give it try. -- Steve