Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4890613rwi; Mon, 17 Oct 2022 12:12:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM634rW2UFCJ49/U7HidSAkEDmbrpHorSRYhJ9F86QrUCpwsfztKC5ZFax1p90u1jyOTRQZ0 X-Received: by 2002:a17:907:62a1:b0:781:b320:90c0 with SMTP id nd33-20020a17090762a100b00781b32090c0mr9349977ejc.255.1666033932419; Mon, 17 Oct 2022 12:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666033932; cv=none; d=google.com; s=arc-20160816; b=HZrywXckBbK8hsb6YPRaD29svHhN9UxluTFlg+UB4oY6gC/Mw9qLIiG7kBW8RFe/Tq 2Ip6vailPWr/iq2ZCK5IFOVR9V+WeV8h9I+OzS+CYSuuSZlykjvAxtaUuvaFM7bFRehA JroMbogSJwZ7jC4kfC5Np/RCRilf7P7lhJkxKrK6hglxrnNINeQwpfVvvDdCtvG56Vci qoyVI13lVf/KJB2ACd/AcZn9diqSVG1PTA9ap34wdRj8zdc2aq4xo4CimRpz1QhiQbRf anG+74CD38RQjmGUmb4e5p30ZQPMpjLVBUfVNdgpvYBZUndkHPgZY2LGnUVIcJ27C0EV jpTA== 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=PxKtMhdF440CyLyO9Bp/sd+1+Jte0emgUww6PKX+O/Q=; b=eT7jb2lF2P3ricGVL0OprGPAp1rnc3oNjrE3wBqVmEfGkZPL6RhF0t0II49lHfUbqX yXkUhzrufE6DXrcxUt770zZfoFpv9x9NnqgfxumcvhBJAqrVpw6IrbgT2dIfjxSbAUeG qWaeQ/CvA2b7pqx3ZLrsPSRXBtXrBzzL93qMAG7TaVcYV5OyjIZUZCM/NqZQCymaC2n8 UTPxbobkO32pryL65uxpD5tgE4thX751AlImUEu4AkvOZKVFWjhvyGOMRPlRelW17AJf napbO0ru4K1gjSQIqw0sf7mc53Aj28MAKNQrthzTUSnRf2W5m/2IBffoaGjNBl6cjiua Vo6Q== 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 en6-20020a056402528600b004534c6c4bd7si8656888edb.433.2022.10.17.12.11.46; Mon, 17 Oct 2022 12:12:12 -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 S230215AbiJQSth (ORCPT + 99 others); Mon, 17 Oct 2022 14:49:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbiJQStf (ORCPT ); Mon, 17 Oct 2022 14:49:35 -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 5142411A17; Mon, 17 Oct 2022 11:49:32 -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 555D3B81A07; Mon, 17 Oct 2022 18:49:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17616C433C1; Mon, 17 Oct 2022 18:49:25 +0000 (UTC) Date: Mon, 17 Oct 2022 14:49:49 -0400 From: Steven Rostedt To: Florent Revest Cc: Xu Kuohai , Mark Rutland , Catalin Marinas , Daniel Borkmann , Xu Kuohai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Will Deacon , Jean-Philippe Brucker , Ingo Molnar , Oleg Nesterov , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Zi Shen Lim , Pasha Tatashin , Ard Biesheuvel , Marc Zyngier , Guo Ren , Masami Hiramatsu Subject: Re: [PATCH bpf-next v2 0/4] Add ftrace direct call for arm64 Message-ID: <20221017144949.2b9dcdc5@gandalf.local.home> In-Reply-To: References: <20220913162732.163631-1-xukuohai@huaweicloud.com> <970a25e4-9b79-9e0c-b338-ed1a934f2770@huawei.com> <2cb606b4-aa8b-e259-cdfd-1bfc61fd7c44@huawei.com> <7f34d333-3b2a-aea5-f411-d53be2c46eee@huawei.com> <20221005110707.55bd9354@gandalf.local.home> <20221005113019.18aeda76@gandalf.local.home> <20221006122922.53802a5c@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 Mon, 17 Oct 2022 19:55:06 +0200 Florent Revest wrote: > Note that I can't really make sense of the perf report with indirect > calls. it always reports it spent 12% of the time in > rethook_trampoline_handler but I verified with both a WARN in that > function and a breakpoint with a debugger, this function does *not* > get called when running this "bench trig-fentry" benchmark. Also it > wouldn't make sense for fprobe_handler to call it so I'm quite > confused why perf would report this call and such a long time spent > there. Anyone know what I could be missing here ? The trace shows __bpf_prog_exit, which I'm guessing is tracing the end of the function. Right? In which case I believe it must call rethook_trampoline_handler: -> fprobe_handler() /* Which could use some "unlikely()" to move disabled paths out of the hot path */ /* And also calls rethook_try_get () which does a cmpxchg! */ -> ret_hook() -> arch_rethook_prepare() Sets regs->lr = arch_rethook_trampoline On return of the function, it jumps to arch_rethook_trampoline() -> arch_rethook_trampoline() -> arch_rethook_trampoline_callback() -> rethook_trampoline_handler() So I do not know how it wouldn't trigger the WARNING or breakpoint if you added it there. -- Steve