From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 09/13] tracing: Have eprobes use filtering logic of trace events
Date: Tue, 07 Dec 2021 16:44:15 -0500 [thread overview]
Message-ID: <20211207214430.584754749@goodmis.org> (raw)
In-Reply-To: 20211207214406.148423650@goodmis.org
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
The eprobes open code the reserving of the event on the ring buffer for
ftrace instead of using the ftrace event wrappers, which means that it
doesn't get affected by the filters, breaking the filtering logic on user
space.
Link: https://lkml.kernel.org/r/20211130024319.068451680@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/trace_eprobe.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
index 928867f527e7..88487752d307 100644
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -489,18 +489,12 @@ __eprobe_trace_func(struct eprobe_data *edata, void *rec)
if (trace_trigger_soft_disabled(edata->file))
return;
- fbuffer.trace_ctx = tracing_gen_ctx();
- fbuffer.trace_file = edata->file;
-
dsize = get_eprobe_size(&edata->ep->tp, rec);
- fbuffer.regs = NULL;
-
- fbuffer.event =
- trace_event_buffer_lock_reserve(&fbuffer.buffer, edata->file,
- call->event.type,
- sizeof(*entry) + edata->ep->tp.size + dsize,
- fbuffer.trace_ctx);
- if (!fbuffer.event)
+
+ entry = trace_event_buffer_reserve(&fbuffer, edata->file,
+ sizeof(*entry) + edata->ep->tp.size + dsize);
+
+ if (!entry)
return;
entry = fbuffer.entry = ring_buffer_event_data(fbuffer.event);
--
2.33.0
next prev parent reply other threads:[~2021-12-07 21:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 21:44 [for-next][PATCH 00/13] tracing: Updates for 5.17 Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 01/13] tracing: Fix spelling mistake "aritmethic" -> "arithmetic" Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 02/13] tracing: Support __rel_loc relative dynamic data location attribute Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 03/13] tracing: Add __rel_loc using trace event macros Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 04/13] samples/trace_event: Add __rel_loc using sample event Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 05/13] libtraceevent: Add __rel_loc relative location attribute support Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 06/13] tools/perf: Add __rel_loc event field parsing support Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 07/13] tracing: Use __this_cpu_read() in trace_event_buffer_lock_reserver() Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 08/13] tracing: Disable preemption when using the filter buffer Steven Rostedt
2021-12-07 21:44 ` Steven Rostedt [this message]
2021-12-07 21:44 ` [for-next][PATCH 10/13] tracing/kprobes: Do not open code event reserve logic Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 11/13] tracing/uprobes: Use trace_event_buffer_reserve() helper Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 12/13] tracing: Fix synth_event_add_val() kernel-doc comment Steven Rostedt
2021-12-07 21:44 ` [for-next][PATCH 13/13] tracing: Switch to kvfree_rcu() API Steven Rostedt
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=20211207214430.584754749@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.