Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1266643lqj; Mon, 3 Jun 2024 16:09:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLprThA3q04X2kmT9TA2PUN6c1VZgy1EkfbVWKlE7woBfMmJ1WZjfUlrBG+oAvoA5EYOUnh3f/Rlz2ztefdV8ZDVvGoGcTS55ceuaHqA== X-Google-Smtp-Source: AGHT+IFSthc/Fo/qwQiSeamCFzGPTqtovqkiBceWEKG0aNb/7hI586sVCCwjKxuK+U3zHGAqMxFR X-Received: by 2002:a05:6a00:148c:b0:6e6:946b:a983 with SMTP id d2e1a72fcca58-702477e4e85mr12377581b3a.10.1717456152112; Mon, 03 Jun 2024 16:09:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717456152; cv=pass; d=google.com; s=arc-20160816; b=tmJFjOwprq0AVHA8m6MJw9kRHdOHbaYP+48AuOZPYY17z8zACHn8TMPoJZQSuKq9Wf UH63w+wk5qPCytiYNgRsSNU70EI4FdE1kaPplWLbsI4o8RMc7NVBRKZysDPZaULMk5AR BehVWJ2lXclgMW2ZeKgECaft+6rN6n+3HrypWUzx1Vk3/jx8frlGvLFsO8qbZKoWuWH+ EHNLuRc/CwWzQ8Bm/plbycOLa7Z1vHuHJsYhZzbK7GKJkTCt1g9q2HkNsqg5fqmHcAZo 8GGWAXNdJR6MiVRkKYlC6wiETfD2GmCtnLRx+L02HkNZI1HfFWmB1+PXyyRdUuTQo0Zk W3Zw== 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:dkim-signature; bh=EZSAPc2yT7XE1rPzpy2prCzpgs6+c0JD2sMNQtAKWGk=; fh=NSnYj6tpGinFvTJElM5X+45jOrnS9GbogdcRlOg2Gnw=; b=ZKM/hUfc2ZgYXGMzsy0AcQGqh5gds83OvOrQpYWD25YWlf0aneNaYz8IseHPCG5aQ9 0k7yOpnfpC75q3YH5spRDOJ3Od78ooCU1JsNK/VQ+pPFI1bAxyvGt/XZH3bbd3g9OhAj PK4RdpBya8l5M21LkTmZX4dkOvXCOZITQrAVoxGMxzvtvdyeK61YZKvu00KTU4qp/Rtd kWvmEBJHGhWyAbjtwGJZmOu3zJSLIsYkCt+LjbbfdZ2PQnH37ALClFmoSPVd8OXeMndP zU7Lflg93rHc0dxDLDJz9MOGxW1wOEVx7DI+FnLuHDr/fGeZx24WSdEEsNih6+/ulS0Y x/kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P2HQh+OK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199808-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35c73c350si7287213a12.739.2024.06.03.16.09.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 16:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199808-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P2HQh+OK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199808-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8D5AE286568 for ; Mon, 3 Jun 2024 23:09:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2AF4713CF98; Mon, 3 Jun 2024 23:09:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P2HQh+OK" 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 48BD482D9C; Mon, 3 Jun 2024 23:09:04 +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=1717456144; cv=none; b=CDOSLoVJkqym3iowgQeN1vZXbQqgHS81RZPn0aMc8csb8MZP77h+/io4t5rrZ4vaSlrUp9UpCbOBfFG6zSqUfhJSfOvas3ofQnS9eQG6YT8OOLUZBoM+vL1QNWBAS7Yft3twjCa4fdR5WMuDn3YYja/S9pgcb5lcmcgt03K8aNA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717456144; c=relaxed/simple; bh=TkGrcacicUpf19NCeKE9v06+R11FzRDylFAvCUhQn8g=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=XjWSaje5lBwWTWguSAgjjaswY785nooKc8Ocm+VPw/CO08AImUgnkAlP8ov2kXvVq/MiZGn4EOw4OK16XBTWILIEBpP2oIyTtzW4IwtcP/YT3tz9qoY+B9NikiphDdbUmTyyE/CbIZAUFaiBiJB6fSbUhw8lXz8O+n3Tg1c2+tE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P2HQh+OK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE1B1C2BD10; Mon, 3 Jun 2024 23:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717456143; bh=TkGrcacicUpf19NCeKE9v06+R11FzRDylFAvCUhQn8g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=P2HQh+OKV93phMVsrP7ajqPOu8NfBDjSsGVzBJ+bbC3qW7hdgzdABzrqXgJnkcYjZ 4lQxkbQQC46IKdaEYdA15eSXciAGQgO67eLQznVKHAEUhYoAsEHZoUkqi8DFJhNJ8h qwRbXstS89bkkpVW/L5wuj/re6lXbZahODUvcRA0EW7x/5jLtRDVb77wGV1/7wCyzX LiQFegSuuaraJuuMLa5rQ1tZyVWGMKHT0SAwi6uYEyBPVrqbQ9YPUbSJlfGX+HppPq 7iHqONwGSHHmv6lSNcIIvlWbTjZR36H/7raUcO24hEp+ECWMD6g3SoJS5gTP8mcVRd Dtx41+2/ayMAw== Date: Tue, 4 Jun 2024 08:08:56 +0900 From: Masami Hiramatsu (Google) To: Steven Rostedt 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: <20240604080856.907194a1fc3106be0cc94fa0@kernel.org> In-Reply-To: <20240603110752.6b722aac@gandalf.local.home> References: <20240602033744.563858532@goodmis.org> <20240602033834.997761817@goodmis.org> <20240603121107.42f98858ebb790805f75c9b1@kernel.org> <20240603110018.1cdd6746@gandalf.local.home> <20240603110752.6b722aac@gandalf.local.home> X-Mailer: Sylpheed 3.7.0 (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 11:07:52 -0400 Steven Rostedt wrote: > On Mon, 3 Jun 2024 11:00:18 -0400 > Steven Rostedt wrote: > > > 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. > > And if we were to go the route of calling a single fgraph_ops caller, I > would want it choreographed with ftrace, such that the direct caller calls > a different fgraph function only if it has only one graph caller on it and > the fgraph loop function if a function has more than one. Just like the > ftrace code does. > > If we are going to go that route, let's do it right. Yes, that is what I expect. ftrace_ops has a callback for loop and subops has another direct callbacks, and the ftrace_ops has a flag to direct subops assign. In this case ftrace will assign the subops's direct callback for single subops entries. But anyway, this optimization can be done afterwards. Especially this feature is important for fprobes on fgraph, until that, the current implementation is enough. Thank you, > > -- Steve -- Masami Hiramatsu (Google)