public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Gautam Menghani <gautammenghani201@gmail.com>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	Xiang wangx <wangxiang@cdjrlc.com>,
	sunliming <sunliming@kylinos.cn>
Subject: [GIT PULL] tracing: Minor fixes and clean ups for 5.19
Date: Thu, 23 Jun 2022 13:23:40 -0400	[thread overview]
Message-ID: <20220623132340.38f48aae@rorschach.local.home> (raw)



Linus,

Tracing fixes:

- Check for NULL in kretprobe_dispatcher()
  NULL can now be passed in, make sure it can handle it

- Clean up unneeded #endif #ifdef of the same preprocessor check in the
  middle of the block.

- Comment clean up

- Remove unneeded initialization of the "ret" variable in
  __trace_uprobe_create()


Please pull the latest trace-v5.19-rc1 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v5.19-rc1

Tag SHA1: 552669fd41f0f967ea7abb1e1b9138280b916208
Head SHA1: 12c3e0c92fd7cb3d3b698d84fdde7dccb6ba8822


Gautam Menghani (1):
      tracing/uprobes: Remove unwanted initialization in __trace_uprobe_create()

Masami Hiramatsu (Google) (1):
      tracing/kprobes: Check whether get_kretprobe() returns NULL in kretprobe_dispatcher()

Xiang wangx (1):
      tracefs: Fix syntax errors in comments

sunliming (1):
      tracing: Simplify conditional compilation code in tracing_set_tracer()

----
 fs/tracefs/inode.c          |  2 +-
 kernel/trace/trace.c        |  2 --
 kernel/trace/trace_kprobe.c | 11 ++++++++++-
 kernel/trace/trace_uprobe.c |  1 -
 4 files changed, 11 insertions(+), 5 deletions(-)
---------------------------
diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c
index de7252715b12..81d26abf486f 100644
--- a/fs/tracefs/inode.c
+++ b/fs/tracefs/inode.c
@@ -553,7 +553,7 @@ struct dentry *tracefs_create_dir(const char *name, struct dentry *parent)
  *
  * Only one instances directory is allowed.
  *
- * The instances directory is special as it allows for mkdir and rmdir to
+ * The instances directory is special as it allows for mkdir and rmdir
  * to be done by userspace. When a mkdir or rmdir is performed, the inode
  * locks are released and the methods passed in (@mkdir and @rmdir) are
  * called without locks and with the name of the directory being created
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2c95992e2c71..a8cfac0611bc 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6424,9 +6424,7 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf)
 		synchronize_rcu();
 		free_snapshot(tr);
 	}
-#endif
 
-#ifdef CONFIG_TRACER_MAX_TRACE
 	if (t->use_max_tr && !had_max_tr) {
 		ret = tracing_alloc_snapshot_instance(tr);
 		if (ret < 0)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 93507330462c..a245ea673715 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -1718,8 +1718,17 @@ static int
 kretprobe_dispatcher(struct kretprobe_instance *ri, struct pt_regs *regs)
 {
 	struct kretprobe *rp = get_kretprobe(ri);
-	struct trace_kprobe *tk = container_of(rp, struct trace_kprobe, rp);
+	struct trace_kprobe *tk;
+
+	/*
+	 * There is a small chance that get_kretprobe(ri) returns NULL when
+	 * the kretprobe is unregister on another CPU between kretprobe's
+	 * trampoline_handler and this function.
+	 */
+	if (unlikely(!rp))
+		return 0;
 
+	tk = container_of(rp, struct trace_kprobe, rp);
 	raw_cpu_inc(*tk->nhit);
 
 	if (trace_probe_test_flag(&tk->tp, TP_FLAG_TRACE))
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 9711589273cd..c3dc4f859a6b 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -546,7 +546,6 @@ static int __trace_uprobe_create(int argc, const char **argv)
 	bool is_return = false;
 	int i, ret;
 
-	ret = 0;
 	ref_ctr_offset = 0;
 
 	switch (argv[0][0]) {

             reply	other threads:[~2022-06-23 18:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 17:23 Steven Rostedt [this message]
2022-06-23 18:30 ` [GIT PULL] tracing: Minor fixes and clean ups for 5.19 pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220623132340.38f48aae@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=gautammenghani201@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=sunliming@kylinos.cn \
    --cc=torvalds@linux-foundation.org \
    --cc=wangxiang@cdjrlc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox