From: Ajay Kaher <akaher@vmware.com>
To: rostedt@goodmis.org, mhiramat@kernel.org, shuah@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, chinglinyu@google.com,
namit@vmware.com, srivatsa@csail.mit.edu, amakhalov@vmware.com,
vsirnapalli@vmware.com, tkundu@vmware.com,
er.ajay.kaher@gmail.com, Ajay Kaher <akaher@vmware.com>
Subject: [PATCH v3 01/10] tracing: Require all trace events to have a TRACE_SYSTEM
Date: Thu, 1 Jun 2023 14:30:04 +0530 [thread overview]
Message-ID: <1685610013-33478-2-git-send-email-akaher@vmware.com> (raw)
In-Reply-To: <1685610013-33478-1-git-send-email-akaher@vmware.com>
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
The creation of the trace event directory requires that a TRACE_SYSTEM is
defined that the trace event directory is added within the system it was
defined in.
The code handled the case where a TRACE_SYSTEM was not added, and would
then add the event at the events directory. But nothing should be doing
this. This code also prevents the implementation of creating dynamic
dentrys for the eventfs system.
As this path has never been hit on correct code, remove it. If it does get
hit, issues a WARN_ON_ONCE() and return ENODEV.
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Ajay Kaher <akaher@vmware.com>
---
kernel/trace/trace_events.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 654ffa404..16bc5ba45 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -2424,14 +2424,15 @@ event_create_dir(struct dentry *parent, struct trace_event_file *file)
/*
* If the trace point header did not define TRACE_SYSTEM
- * then the system would be called "TRACE_SYSTEM".
+ * then the system would be called "TRACE_SYSTEM". This should
+ * never happen.
*/
- if (strcmp(call->class->system, TRACE_SYSTEM) != 0) {
- d_events = event_subsystem_dir(tr, call->class->system, file, parent);
- if (!d_events)
- return -ENOMEM;
- } else
- d_events = parent;
+ if (WARN_ON_ONCE(strcmp(call->class->system, TRACE_SYSTEM) == 0))
+ return -ENODEV;
+
+ d_events = event_subsystem_dir(tr, call->class->system, file, parent);
+ if (!d_events)
+ return -ENOMEM;
name = trace_event_name(call);
file->dir = tracefs_create_dir(name, d_events);
--
2.40.0
next prev parent reply other threads:[~2023-06-01 9:01 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-01 9:00 [PATCH v3 00/10] tracing: introducing eventfs Ajay Kaher
2023-06-01 9:00 ` Ajay Kaher [this message]
2023-06-01 9:00 ` [PATCH v3 02/10] eventfs: introducing struct tracefs_inode Ajay Kaher
2023-07-01 13:25 ` Steven Rostedt
2023-07-02 14:55 ` Masami Hiramatsu
2023-06-01 9:00 ` [PATCH v3 03/10] eventfs: adding eventfs dir add functions Ajay Kaher
2023-07-01 13:54 ` Steven Rostedt
2023-07-03 10:13 ` Ajay Kaher
2023-07-03 15:08 ` Steven Rostedt
2023-07-03 18:51 ` Ajay Kaher
2023-07-03 19:52 ` Steven Rostedt
[not found] ` <20230709215447.536defa6@rorschach.local.home>
2023-07-10 2:17 ` Nadav Amit
2023-07-10 2:53 ` Steven Rostedt
2023-07-10 18:53 ` Ajay Kaher
2023-07-10 19:06 ` Steven Rostedt
[not found] ` <20230710150731.4ec2b9f8@gandalf.local.home>
2023-07-10 19:10 ` Steven Rostedt
2023-07-10 20:15 ` Steven Rostedt
2023-07-10 21:09 ` Steven Rostedt
2023-07-11 14:24 ` Steven Rostedt
2023-06-01 9:00 ` [PATCH v3 04/10] eventfs: adding eventfs file " Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 05/10] eventfs: adding eventfs file, directory remove function Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 06/10] eventfs: adding functions to create eventfs files and directories Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 07/10] eventfs: adding eventfs lookup, read, open functions Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 08/10] eventfs: creating tracefs_inode_cache Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 09/10] eventfs: moving tracing/events to eventfs Ajay Kaher
2023-06-10 15:25 ` kernel test robot
2023-06-13 7:06 ` Ajay Kaher
2023-06-01 9:00 ` [PATCH v3 10/10] test: ftrace: fix kprobe test for eventfs Ajay Kaher
2023-06-13 8:21 ` Masami Hiramatsu
2023-06-01 9:07 ` [PATCH v3 00/10] tracing: introducing eventfs Ajay Kaher
2023-06-19 5:38 ` Ajay Kaher
2023-06-20 15:02 ` Steven Rostedt
2023-06-21 11:42 ` Ajay Kaher
2023-06-22 3:31 ` Masami Hiramatsu
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=1685610013-33478-2-git-send-email-akaher@vmware.com \
--to=akaher@vmware.com \
--cc=amakhalov@vmware.com \
--cc=chinglinyu@google.com \
--cc=er.ajay.kaher@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=namit@vmware.com \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=srivatsa@csail.mit.edu \
--cc=tkundu@vmware.com \
--cc=vsirnapalli@vmware.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;
as well as URLs for NNTP newsgroup(s).