From mboxrd@z Thu Jan 1 00:00:00 1970 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 C3B63367F49; Thu, 12 Mar 2026 11:47:55 +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=1773316075; cv=none; b=YbI4eCjKSsRIS1KQV1gGfSClSkyLNcESyVStU5oEgMG0gLvCvodE/9ehIekpWHgYN0Ts1n5NrBE+qmExgkuCW1/D3efgEObp88yusdYdr2Exgrxyuk5iyjyxj41/k5qYWzTkIvIWRcFiTWj44aHsof3SgRNi4GPbv6L60VsRIPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773316075; c=relaxed/simple; bh=esTr7PhdcjBhEg2Hr3c1jb7TUJvUJMSTS/duDJ7I7c0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ii/lkLXCRABbvdPv08v57CBLrpB7g573qeVV7XPOJM/xrWmBcS3ZMr/2jxLHbkuegL7e9bYYOj9fD8MnxCCeo0Oh5LzYJxRoOLcmEBgL6/btp695SQywziPc3zDlIdZEKPBXdUOF2kicP8Qv8cAMZBdfFYwN9Ci9i0QGhHHFpXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sAA+mbiY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sAA+mbiY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6BB6C4CEF7; Thu, 12 Mar 2026 11:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773316075; bh=esTr7PhdcjBhEg2Hr3c1jb7TUJvUJMSTS/duDJ7I7c0=; h=From:To:Cc:Subject:Date:From; b=sAA+mbiYNtBjDdW5ZwXtnfWMB4hM5wGgLHd4tZaGfUq+bdK2dQCz1t2bjMFkvHYxb c1jT3LQgI0ZbG8izS89xIxd3kR+n6XTYYMwlEB8WCnguhO8iHUe/67xBNF89tS/6Mi dkuwA3+/grOEQoz3aCUNNb8yS+2cIR2Nz3AYTdA1QJPrnUZwlHgFIzKAqGf3/RlcL0 +XUo9E7RaoULSvi+KGlXk+ZQXVEebR6pI2YjU+FR5+B0F19zaNo8mwjwWsbL5a+AXU 6SNVY7MjyMQeYoZoN3kffkmXIHwsouPYTEWFukJ7Ic9aprnFhRXr1lORqgLGAGWZDo oUVfCDdfBp5Ow== From: Jiri Olsa To: Steven Rostedt , Alexei Starovoitov Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Daniel Borkmann , Andrii Nakryiko , Menglong Dong , Song Liu Subject: [PATCH bpf-next] ftrace: Use hash argument for tmp_ops in update_ftrace_direct_mod Date: Thu, 12 Mar 2026 12:47:46 +0100 Message-ID: <20260312114746.122174-1-jolsa@kernel.org> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The modify logic registers temporary ftrace_ops object (tmp_ops) to trigger the slow path for all direct callers to be able to safely modify attached addresses. At the moment we use ops->func_hash for tmp_ops filter, which represents all the systems attachments. It's faster to use just the passed hash filter, which contains only the modified sites is always a subset of the ops->func_hash. Fixes: e93672f770d7 ("ftrace: Add update_ftrace_direct_mod function") Signed-off-by: Jiri Olsa --- kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8df69e702706..71dcbfeac86c 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -6608,7 +6608,7 @@ int update_ftrace_direct_mod(struct ftrace_ops *ops, struct ftrace_hash *hash, b /* Enable the tmp_ops to have the same functions as the direct ops */ ftrace_ops_init(&tmp_ops); - tmp_ops.func_hash = ops->func_hash; + tmp_ops.func_hash->filter_hash = hash; err = register_ftrace_function_nolock(&tmp_ops); if (err) -- 2.53.0