Skip to contentSkip to conversation

tracing: A couple more minor fixes

GIT PULL Merged Steven Rostedt 2 participants 2 messages Apr 7, 2023 – Apr 8, 2023

Subsystems (2)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

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_direct()

----

 kernel/trace/ftrace.c             | 15 +++++++++------
 kernel/trace/trace_events_synth.c |  2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

---------------------------

kernel/trace/ftrace.c +9 -6
index 0feea145bb29..c67bcc89a771 100644
@@ -5667,12 +5667,15 @@ int modify_ftrace_direct(unsigned long ip,
 		ret = 0;
 	}
 
-	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 = old_addr;
+		if (unlikely(new_direct)) {
+			direct->count++;
+			list_del_rcu(&new_direct->next);
+			synchronize_rcu_tasks();
+			kfree(new_direct);
+			ftrace_direct_func_count--;
+		}
 	}
 
  out_unlock:
kernel/trace/trace_events_synth.c +1 -1
index f0ff730125bf..d6a70aff2410 100644
@@ -44,7 +44,7 @@ enum { ERRORS };
 
 static const char *err_text[] = { ERRORS };
 
-DEFINE_MUTEX(lastcmd_mutex);
+static DEFINE_MUTEX(lastcmd_mutex);
 static char *last_cmd;
 
 static int errpos(const char *str)
merge bot Merged
#1 lore raw
The pull request you sent on Fri, 7 Apr 2023 16:33:43 -0400:

The pull request you sent on Fri, 7 Apr 2023 16:33:43 -0400:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v6.3-rc5-2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/1a8a804a4f5d6d0ec77831ca776b8db4a7a98306

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html