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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF7B2C55179 for ; Thu, 22 Oct 2020 13:35:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F752222E9 for ; Thu, 22 Oct 2020 13:35:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2900173AbgJVNfP (ORCPT ); Thu, 22 Oct 2020 09:35:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:55874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbgJVNfP (ORCPT ); Thu, 22 Oct 2020 09:35:15 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C46B720BED; Thu, 22 Oct 2020 13:35:12 +0000 (UTC) Date: Thu, 22 Oct 2020 09:35:10 -0400 From: Steven Rostedt To: Jiri Olsa Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Daniel Xu , Jesper Brouer , Toke =?UTF-8?B?SMO4aWxhbmQtSsO4cmdlbnNlbg==?= , Viktor Malik Subject: Re: [RFC bpf-next 00/16] bpf: Speed up trampoline attach Message-ID: <20201022093510.37e8941f@gandalf.local.home> In-Reply-To: <20201022082138.2322434-1-jolsa@kernel.org> References: <20201022082138.2322434-1-jolsa@kernel.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 22 Oct 2020 10:21:22 +0200 Jiri Olsa wrote: > hi, > this patchset tries to speed up the attach time for trampolines > and make bpftrace faster for wildcard use cases like: > > # bpftrace -ve "kfunc:__x64_sys_s* { printf("test\n"); }" > > Profiles show mostly ftrace backend, because we add trampoline > functions one by one and ftrace direct function registering is > quite expensive. Thus main change in this patchset is to allow > batch attach and use just single ftrace call to attach or detach > multiple ips/trampolines. The issue I have with this change is that the purpose of the direct trampoline was to give bpf access to the parameters of a function as if it was called directly. That is, it could see the parameters of a function quickly. I even made the direct function work if it wanted to also trace the return code. What the direct calls is NOT, is a generic tracing function tracer. If that is required, then bpftrace should be registering itself with ftrace. If you are attaching to a set of functions, where it becomes obvious that its not being used to access specific parameters, then that's an abuse of the direct calls. We already have one generic function tracer, we don't need another. -- Steve