Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1876227iob; Fri, 29 Apr 2022 15:12:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytXEb2hjdIpAixPBtlNrumwARvu2SU5STMa5TIuiA32Ihg+lvEnZ3wfJzaUv7vCvTxio3G X-Received: by 2002:a05:6512:3141:b0:472:11e5:2fc5 with SMTP id s1-20020a056512314100b0047211e52fc5mr952852lfi.305.1651270323557; Fri, 29 Apr 2022 15:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651270323; cv=none; d=google.com; s=arc-20160816; b=0fR546jrXRlzNgxMyRgkY71RHsoLmjfMZriCpIQ6YLrhnDzooo6KJodda/iyh8jbOO Ho6ZtMgf/Dk75WlJo0Tkg3B3hqO36qFD/mAwqEFHMn0kCjB/ttHW2h7ybD0OwfQ7piDy nkNAu61YOVj9Vx5BoRlCvXRoBeK9/85fBOlX6kg46WuVUye9nIZaqwEYuuv9WxRkeIuy eic4vQP/uADeEDxAfZCoHTTRETfkjbtTZl7kBfW4pJQ2fJ2wkoTtN69NrPvO2Y+8h13k TeS1TO3GPwv4h8cD8I/iEY0+PpUcNKDG0hXkucosksvJsFXtSDnNTvkBtUDLI2pqrg1g CY/w== 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=BzaZMWZfNiArq6XeXLCo1OfBs+8YFdm73alywKcTkjE=; b=lKDrvz0R2Yuyn5vWWFKgOBa+cBCtXJ3KQg4rV1RxMqGKK9VBb7tyhDfAqWEsBA2HAT ZcXhVuibeQqDrlrOoyds3nAK9uKZm79jZiH1NVZ55WPdC5YEyps/z5z3l2ZWywpHcrAR 6Zm49NwOIe0vHBV+UY4l715z9zg0yhijUdOUCkuUia+dj5o7OoMISvjiiIgYvOvb/ZNN C2NBnm/okjfzAS9y7xpKS//f377owJLSWEOOCzIoBGO/DILjXn+lDYp6P9xBoDHr/fGm k9Vz107a9T7Ff1S0AMnKO1FHCFGIcphi7vRdNxJ+D5BBebjf0B97D36gwZj7NnOFnjCR Uu4A== 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 k36-20020a0565123da400b0046bfbbf5d19si9524819lfv.6.2022.04.29.15.11.35; Fri, 29 Apr 2022 15:12:03 -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 S1352333AbiD2AfQ (ORCPT + 99 others); Thu, 28 Apr 2022 20:35:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234331AbiD2AfO (ORCPT ); Thu, 28 Apr 2022 20:35:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 288A6B9F02; Thu, 28 Apr 2022 17:31:57 -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 AD912B83260; Fri, 29 Apr 2022 00:31:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D298DC385A9; Fri, 29 Apr 2022 00:31:53 +0000 (UTC) Date: Thu, 28 Apr 2022 20:31:52 -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: <20220428203152.41693bbe@gandalf.local.home> In-Reply-To: <20220428200945.5f6a5ba2@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> <20220428200945.5f6a5ba2@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 20:09:45 -0400 Steven Rostedt wrote: > 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. Never mind, in testing this I had marked the weak function as notrace, which was the reason I couldn't add it to the set_ftrace_notrace. After removing the notrace, kallsyms_lookup() doesn't make a difference. It appears that kallsyms will include overridden weak functions into the size of the function before it. I tried: ret = kallsyms_lookup(rec->ip, &size, &offset, &modname, str); if (!ret || offset > size) { seq_printf(m, "no function at %lx", rec->ip); } else { seq_printf(m, "%s", str); if (modname) seq_printf(m, " [%s]", modname); } And it made no difference. > > This does indeed look like a bug in %ps. > Yes, this does appear to be a issue with kallsyms in general. -- Steve