From nobody Wed Feb 11 14:03:48 2026 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 9D9CCC6FD1D for ; Fri, 7 Apr 2023 20:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229567AbjDGUfS (ORCPT ); Fri, 7 Apr 2023 16:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231715AbjDGUfP (ORCPT ); Fri, 7 Apr 2023 16:35:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2451ACA20 for ; Fri, 7 Apr 2023 13:34:42 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 422D4612CE for ; Fri, 7 Apr 2023 20:33:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1B78C433D2; Fri, 7 Apr 2023 20:33:47 +0000 (UTC) Date: Fri, 7 Apr 2023 16:33:43 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Andrew Morton , Zheng Yejian Subject: [GIT PULL] tracing: A couple more minor fixes Message-ID: <20230407163343.2a8b780d@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Linus, Some more tracing fixes for 6.3: - Reset direct->addr back to its original value on error in updating the direct trampoline code. - Make lastcmd_mutex static. Please pull the latest trace-v6.3-rc5-2 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v6.3-rc5-2 Tag SHA1: 6eaf0925d5343e35303a4e3dc0082f889c9d8d78 Head SHA1: 31c683967174b487939efaf65e41f5ff1404e141 Steven Rostedt (Google) (1): tracing/synthetic: Make lastcmd_mutex static Zheng Yejian (1): ftrace: Fix issue that 'direct->addr' not restored in modify_ftrace_d= irect() ---- kernel/trace/ftrace.c | 15 +++++++++------ kernel/trace/trace_events_synth.c | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) --------------------------- diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 0feea145bb29..c67bcc89a771 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -5667,12 +5667,15 @@ int modify_ftrace_direct(unsigned long ip, ret =3D 0; } =20 - if (unlikely(ret && new_direct)) { - direct->count++; - list_del_rcu(&new_direct->next); - synchronize_rcu_tasks(); - kfree(new_direct); - ftrace_direct_func_count--; + if (ret) { + direct->addr =3D old_addr; + if (unlikely(new_direct)) { + direct->count++; + list_del_rcu(&new_direct->next); + synchronize_rcu_tasks(); + kfree(new_direct); + ftrace_direct_func_count--; + } } =20 out_unlock: diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_= synth.c index f0ff730125bf..d6a70aff2410 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -44,7 +44,7 @@ enum { ERRORS }; =20 static const char *err_text[] =3D { ERRORS }; =20 -DEFINE_MUTEX(lastcmd_mutex); +static DEFINE_MUTEX(lastcmd_mutex); static char *last_cmd; =20 static int errpos(const char *str)