From: Ajay Kaher <akaher@vmware.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: kernel test robot <lkp@intel.com>,
"mhiramat@kernel.org" <mhiramat@kernel.org>,
"shuah@kernel.org" <shuah@kernel.org>,
"llvm@lists.linux.dev" <llvm@lists.linux.dev>,
"oe-kbuild-all@lists.linux.dev" <oe-kbuild-all@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-trace-kernel@vger.kernel.org"
<linux-trace-kernel@vger.kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"chinglinyu@google.com" <chinglinyu@google.com>,
Nadav Amit <namit@vmware.com>,
Srivatsa Bhat <srivatsab@vmware.com>,
"srivatsa@csail.mit.edu" <srivatsa@csail.mit.edu>,
Alexey Makhalov <amakhalov@vmware.com>,
Vasavi Sirnapalli <vsirnapalli@vmware.com>,
Tapas Kundu <tkundu@vmware.com>,
"er.ajay.kaher@gmail.com" <er.ajay.kaher@gmail.com>
Subject: Re: [PATCH v2 8/9] eventfs: moving tracing/events to eventfs
Date: Wed, 10 May 2023 11:11:15 +0000 [thread overview]
Message-ID: <400E4466-629C-4306-86B1-E8BA0CB5EF66@vmware.com> (raw)
In-Reply-To: <20230509124559.0d5557ad@rorschach.local.home>
> On 09-May-2023, at 10:15 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
> !! External Email
>
> On Tue, 9 May 2023 12:29:23 +0000
> Ajay Kaher <akaher@vmware.com> wrote:
>
>> > On 02/05/23, 11:42 PM, "kernel test robot" <lkp@intel.com> wrote:
>>>>> kernel/trace/trace_events.c:2424:17: warning: variable 'd_events' set but not used [-Wunused-but-set-variable]
>>> struct dentry *d_events;
>>> ^
>>> 1 warning generated.
>>>
>>
>> Steve, with-in event_create_dir(), do we have any scenario when file->event_call->class->system
>> doesn't have TRACE_SYSTEM? And need to execute following:
>>
>> ae63b31e4d0e2e Steven Rostedt 2012-05-03 2437 d_events = parent;
>>
>> looking for your input if we could remove d_events from event_create_dir().
>>
>
> I have hit this in the beginning, but I don't think it's an issue
> anymore. Perhaps just have it be:
>
> if (WARN_ON_ONCE(strcmp(call->class->system, TRACE_SYSTEM) == 0))
> return -ENODEV;
>
> ef_subsystem = event_subsystem_dir(tr, call->class->system, file, parent);
>
> Hmm, how about just add this patch before your patch set:
>
Sounds good. Thanks Steve :)
Once you will merge below patch, I will rebase this patch in v3.
- Ajay
>
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> Subject: [PATCH] tracing: Require all trace events to have a TRACE_SYSTEM
>
> 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>
> ---
>
> (lightly tested)
>
> 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 654ffa40457a..16bc5ba45507 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.39.2
>
>
> !! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
next prev parent reply other threads:[~2023-05-10 11:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 11:23 [PATCH v2 0/9] tracing: introducing eventfs Ajay Kaher
2023-05-02 11:23 ` [PATCH v2 1/9] eventfs: introducing struct tracefs_inode Ajay Kaher
2023-05-02 11:23 ` [PATCH v2 2/9] eventfs: adding eventfs dir add functions Ajay Kaher
2023-05-08 9:32 ` Zheng Yejian
2023-05-10 11:25 ` Ajay Kaher
2023-06-19 5:24 ` Ajay Kaher
2023-05-02 11:23 ` [PATCH v2 3/9] eventfs: adding eventfs file " Ajay Kaher
2023-05-02 11:23 ` [PATCH v2 4/9] eventfs: adding eventfs file, directory remove function Ajay Kaher
2023-05-02 14:21 ` kernel test robot
2023-05-02 16:04 ` kernel test robot
2023-05-02 22:15 ` kernel test robot
2023-05-02 11:23 ` [PATCH v2 5/9] eventfs: adding functions to create eventfs files and directories Ajay Kaher
2023-05-02 11:23 ` [PATCH v2 6/9] eventfs: adding eventfs lookup, read, open functions Ajay Kaher
2023-05-02 11:23 ` [PATCH v2 7/9] eventfs: creating tracefs_inode_cache Ajay Kaher
2023-05-02 11:23 ` [PATCH v2 8/9] eventfs: moving tracing/events to eventfs Ajay Kaher
2023-05-02 13:40 ` kernel test robot
2023-05-02 18:07 ` kernel test robot
2023-05-09 12:29 ` Ajay Kaher
2023-05-09 16:45 ` Steven Rostedt
2023-05-10 11:11 ` Ajay Kaher [this message]
2023-05-12 22:59 ` Steven Rostedt
2023-05-15 11:35 ` Ajay Kaher
2023-05-05 9:37 ` kernel test robot
2023-05-17 12:40 ` Ajay Kaher
2023-05-17 14:14 ` Steven Rostedt
2023-05-02 11:23 ` [PATCH v2 9/9] test: ftrace: fix kprobe test for eventfs Ajay Kaher
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=400E4466-629C-4306-86B1-E8BA0CB5EF66@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=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=mhiramat@kernel.org \
--cc=namit@vmware.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=srivatsa@csail.mit.edu \
--cc=srivatsab@vmware.com \
--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