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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ECF7C4332F for ; Wed, 23 Nov 2022 03:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235267AbiKWDRS (ORCPT ); Tue, 22 Nov 2022 22:17:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232723AbiKWDRR (ORCPT ); Tue, 22 Nov 2022 22:17:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9630D8CBAC; Tue, 22 Nov 2022 19:17:16 -0800 (PST) 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 2B894B81CB2; Wed, 23 Nov 2022 03:17:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 137EAC433D7; Wed, 23 Nov 2022 03:17:12 +0000 (UTC) Date: Tue, 22 Nov 2022 22:17:11 -0500 From: Steven Rostedt To: Song Shuai Cc: LKML , Linux Trace Kernel , Masami Hiramatsu Subject: Re: [PATCH] ftrace: Avoid needless updates of the ftrace function call Message-ID: <20221122221711.402b360f@rorschach.local.home> In-Reply-To: References: <20221122180905.737b6f52@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 Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org On Wed, 23 Nov 2022 10:29:28 +0800 Song Shuai wrote: > > @@ -2783,7 +2796,7 @@ void ftrace_modify_all_code(int command) > > * traced. > > */ > > if (update) { > > - err = ftrace_update_ftrace_func(ftrace_ops_list_func); > > + err = update_ftrace_func(ftrace_ops_list_func); > > if (FTRACE_WARN_ON(err)) > > return; > > } > > @@ -2799,7 +2812,7 @@ void ftrace_modify_all_code(int command) > > /* If irqs are disabled, we are in stop machine */ > > if (!irqs_disabled()) > > smp_call_function(ftrace_sync_ipi, NULL, 1); > > - err = ftrace_update_ftrace_func(ftrace_trace_function); > > + err = update_ftrace_func(ftrace_trace_function); > The helper function should only serve the ftrace_ops_list_func. > > And ftrace_trace_function is always different in this function with > FTRACE_UPDATE_TRACE_FUNC command. > > So this place should be left as it is. But it is needed to update the static variable. Without this change, then save_func will get set to ftrace_ops_list_func and never change after that and then the update to ftrace_ops_list_func will stop happening. -- Steve