Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1019390lqj; Mon, 3 Jun 2024 07:59:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+gGE2asTV+GK9nTFLJZ4ByRMxWSEu0cna22D/UgbiPyUo8JKQHO4H4BveQzU2TDzes1KBlhzTV9LTuCoFlpFuLj3bJhkhKhY1KZAk0A== X-Google-Smtp-Source: AGHT+IGNS2ZpV5LI3/CAEVxJ4Sy7/SelWsCSPA4cQfmRIPO5oEySjiPY8h/S6kpPdNc2tMHm/TNQ X-Received: by 2002:a50:f696:0:b0:578:5bf4:1ce2 with SMTP id 4fb4d7f45d1cf-57a1a8273c1mr9599098a12.21.1717426764299; Mon, 03 Jun 2024 07:59:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717426764; cv=pass; d=google.com; s=arc-20160816; b=aIolZqTGUkPI4MTDB+NuJCmj3Xf4ep08iFpGsoa6W17F11u7JOOeDNzXbuf/mPKuET 25tXuNiFxlA43XE1kAmJPJMF4WVZV9MxBzplMj7ERsXu8i40LKzr9/7sPCa5thWrNyHM WWjV/+zEsVHMwcCxTuNFAwvkoi23nV56qxhIS5HhQ53GeBn62XhVFj95CEwAVrjim+On /7/w9ZmjOeYIdqHyQcm7eFncXzPACjffSTZFGLdrHCEun7u0y442F+ALiOb0VMLtpOFY /VSdksY+70NRVBcMq/ofm/xDzCCTqcuWRugGykzfAEa9iDZVi8S4GnAp0GVP/YlNVAkE YdKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=j+G8l5eRM0bHY3YFV42iKBSOuabfpS8sRzkRdglEqQE=; fh=CONbk9IM1KeoX7M3ojYzAuH3rM9roTZPm7jJ9UBDXA8=; b=iHXjf+8aC9+7urXw0DApZOQlz3KQXRxQ8lLOWgkE6vLJwm0wmU8y0kWKsfqUIVHQfU 3+iURi0L2hY3KeUNXICTe+duRL8dqCC4o3JhXJFu0bjxmU/M8puijFRrQHxEK/aGZO4r BZ0QYrOcW4UsbHHpMPxgwv23rygVHYbDiKHlYnjvU9P+7aQ8m78zUckpvAtwlZQ5k0Ql sO4YBznMzl/jfSbWQ1XXnAK1XmTZNkcmYjLHEb55JDBfNLzSLPFZ0cShoPi4uPTu2kTR R7TPUZUnTZafrTDWlPVcmP4yOPSmzzNsoJdHNNqlJn6xdmPNvdiLFh0bhSvwEnOp0GMx oRKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-199328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199328-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31c62e50si4076184a12.336.2024.06.03.07.59.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 07:59:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-199328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199328-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 038E61F2219A for ; Mon, 3 Jun 2024 14:59:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A63581304AA; Mon, 3 Jun 2024 14:59:15 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 255EE82D8E; Mon, 3 Jun 2024 14:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717426755; cv=none; b=IMSHv0ik0ILYQi8OmthABXVW3gyLzFwEOUFFIF9A3PVzbPo/kU4ClL7szOXsMOmGSVQudw9d2nOUwypPdGnEQ357ffcUrRmt0qbJSkKcWDr56xg+UTgV77OPjlOZAFHQeR5pFPasJKYd9iyxyEbabQHS39GesvM74rq3QEQZRC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717426755; c=relaxed/simple; bh=DBDHC1nWAFD49PJim5SC6PnxIBcdo9JUB9EaWjVgVdk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ALfkmID1jDe50mKnHzT/1EreJiADrMzocU/MKs7Un7ASXS7HXTcvCquOmSGmThy/GfzZf4Am8Z0dKS+c+US2df3xxebT6p0aD6qtQPMp1CNNacB5UU3WkXww3Bq48gIpqtMEL1ElOsewPtoo57kSNMvEQ+4TxOckZmy1pxVi66E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCDD1C2BD10; Mon, 3 Jun 2024 14:59:09 +0000 (UTC) Date: Mon, 3 Jun 2024 11:00:18 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Mark Rutland , Mathieu Desnoyers , Andrew Morton , Alexei Starovoitov , Florent Revest , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: Re: [PATCH v2 24/27] function_graph: Use static_call and branch to optimize entry function Message-ID: <20240603110018.1cdd6746@gandalf.local.home> In-Reply-To: <20240603121107.42f98858ebb790805f75c9b1@kernel.org> References: <20240602033744.563858532@goodmis.org> <20240602033834.997761817@goodmis.org> <20240603121107.42f98858ebb790805f75c9b1@kernel.org> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 3 Jun 2024 12:11:07 +0900 Masami Hiramatsu (Google) wrote: > > From: "Steven Rostedt (Google)" > > > > In most cases function graph is used by a single user. Instead of calling > > a loop to call function graph callbacks in this case, call the function > > entry callback directly. > > > > Add a static_key that will be used to set the function graph logic to > > either do the loop (when more than one callback is registered) or to call > > the callback directly if there is only one registered callback. > > I understand this works, but my concern is that, if we use fprobe > and function_graph at the same time, does it always loop on both gops? > > I mean if those are the subops of one ftrace_ops, ftrace_trampoline > will always call the same function_graph_enter() for both gops, and loop > on the gops list. > > For example, if there are 2 fgraph_ops, one has "vfs_*" filter and > another has "sched_*" filter, those does not cover each other. > > Are there any way to solve this issue? I think my previous series > calls function_graph_enter_ops() directly from trampoline (If it works > correctly...) Yes, but that gets a bit complex, and requires the changing of all archs. If it starts to become a problem, I rather add that as a feature. That is, we can always go back to it. But for now, lets keep the complexity down. -- Steve