From nobody Sun Feb 8 14:10:20 2026 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 0163A18C01E for ; Wed, 5 Mar 2025 03:50:31 +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=1741146632; cv=none; b=ktKtTpIUnz+u4DYPqUUQcZcj9NRbjcGtracDxX8SJYycbgqGGFATMBmRBx0wbqEsiGIYJZFTI96ZUjPHhaI7BKJzK/ECyVcVTLZF6jNTcRiqQOZSyLjZLNQKoAl1hfL6Fuyqqrr0oV5OU8ngaP/D6I7/ACvnyIuof6fTuMiq5AY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741146632; c=relaxed/simple; bh=f5zHQtYHx+2zBb4Fx/oiKb2X39t0J40I20Ws+Qb07A0=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=LGenIpmQ6BUnRVF1WHk6eKvAySAcz8tLn0Ras7tHMaAZqkWXPbmljN9sTpX6DXgAAaFSFbfGxsseIlepkqmW+QWUI/OZMgg3noCo4GkMoDNh9aDXa8g8VtnW59vEAN60pHQ2lwZQAHNNTNF8zfzK5Qzzse90/SDvI1cU3MHucOQ= 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 9A258C4CEEA; Wed, 5 Mar 2025 03:50:31 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1tpfn6-0000000CYWP-0JNO; Tue, 04 Mar 2025 22:51:28 -0500 Message-ID: <20250305035127.922362057@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 04 Mar 2025 22:51:12 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Sven Schnelle , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Donglin Peng , Zheng Yejian Subject: [for-next][PATCH 5/6] ftrace: Have funcgraph-args take affect during tracing References: <20250305035107.307030265@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt Currently, when function_graph is started, it looks at the option funcgraph-args, and if it is set, it will enable tracing of the arguments. But if tracing is already running, and the user enables funcgraph-args, it will have no effect. Instead, it should enable argument tracing when it is enabled, even if it means disabling the function graph tracing for a short time in order to do the transition. Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Andrew Morton Cc: Sven Schnelle Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Guo Ren Cc: Donglin Peng Cc: Zheng Yejian Link: https://lore.kernel.org/20250227185822.978998710@goodmis.org Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_functions_graph.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_func= tions_graph.c index 5049fe25ceef..71b2fb068b6b 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -464,7 +464,7 @@ static int graph_trace_init(struct trace_array *tr) else tr->gops->retfunc =3D trace_graph_return; =20 - /* Make gops functions are visible before we start tracing */ + /* Make gops functions visible before we start tracing */ smp_mb(); =20 ret =3D register_ftrace_graph(tr->gops); @@ -475,6 +475,28 @@ static int graph_trace_init(struct trace_array *tr) return 0; } =20 +static int ftrace_graph_trace_args(struct trace_array *tr, int set) +{ + trace_func_graph_ent_t entry; + + if (set) + entry =3D trace_graph_entry_args; + else + entry =3D trace_graph_entry; + + /* See if there's any changes */ + if (tr->gops->entryfunc =3D=3D entry) + return 0; + + unregister_ftrace_graph(tr->gops); + + tr->gops->entryfunc =3D entry; + + /* Make gops functions visible before we start tracing */ + smp_mb(); + return register_ftrace_graph(tr->gops); +} + static void graph_trace_reset(struct trace_array *tr) { tracing_stop_cmdline_record(); @@ -1607,6 +1629,9 @@ func_graph_set_flag(struct trace_array *tr, u32 old_f= lags, u32 bit, int set) if (bit =3D=3D TRACE_GRAPH_GRAPH_TIME) ftrace_graph_graph_time_control(set); =20 + if (bit =3D=3D TRACE_GRAPH_ARGS) + return ftrace_graph_trace_args(tr, set); + return 0; } =20 --=20 2.47.2