From: Steven Rostedt <rostedt@goodmis.org>
To: Gabriele Paoloni <gpaoloni@redhat.com>
Cc: mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
acarmina@redhat.com, chuck.wolber@boeing.com
Subject: Re: [RFC PATCH 2/2] tracing: add testable specifications for event_enable_write/read
Date: Wed, 2 Jul 2025 11:12:45 -0400 [thread overview]
Message-ID: <20250702111245.1fa23138@batman.local.home> (raw)
In-Reply-To: <CA+wEVJarZben=F3Dw0A8_tvAAR7-qb4PrjCj0AGFoq=DH1RJwg@mail.gmail.com>
On Wed, 2 Jul 2025 16:59:29 +0200
Gabriele Paoloni <gpaoloni@redhat.com> wrote:
> Mmm got it. What about
>
> * Function's expectations:
> * - This function shall lock the global event_mutex before performing any
> * operation on the target event file and unlock it after all operations on
> * the target event file have completed;
Since 99% of the time that a lock is taken in a function it is
released, I think that should be the default assumption here, and only
when a lock is taken and not release, that should be explicitly called
out.
And also we should remove "This function" we know that these
requirements are for this function.
- The global event_mutex shall be taken before performing any
operation on the target event.
Should be good enough.
If the lock can be released and taken again, that too should be
explicit in the requirements otherwise it is assumed it is taken once
and not released until the operation is completed.
> *
> * - This function shall format the string copied to userspace according to
> * the status flags retrieved from the target event file:
> * - The first character shall be set to "1" if the enabled flag is
> set AND the
> * soft_disabled flag is not set, else it shall be set to "0";
> * - The second character is optional and shall be set to "*" if either the
> * soft_disabled flag or the soft_mode flag is set;
> * - The string shall be terminated by a newline ("\n") and any remaining
> * character shall be set to "0";
- The string copied to user space shall be formatted according to the
status flags from the target event file:
- If the enable flag is set AND the soft_disable flag is not set then
the first character shall be set to "1" ELSE it shall be set to "0"
- If either the soft_disable fag or the soft_mode flag is set then the
second character shall be set to "*" ELSE it is skipped.
I think the above is easier to read and is a bit more consolidated.
Stating the status then the effect is also easier to read.
-- Steve
> *
> * - This function shall invoke simple_read_from_buffer() to perform the copy
> * of the kernel space string to ubuf.
>
> (pls note that the check on cnt has been removed in v3 that is out already)
next prev parent reply other threads:[~2025-07-02 15:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 10:43 [RFC PATCH 0/2] tracing: ftrace_enable_fops fixes Gabriele Paoloni
2025-06-12 10:43 ` [RFC PATCH 1/2] tracing: fixes of ftrace_enable_fops Gabriele Paoloni
2025-06-13 2:45 ` Masami Hiramatsu
2025-06-19 17:07 ` Gabriele Paoloni
2025-06-20 9:35 ` Masami Hiramatsu
2025-06-20 13:26 ` Gabriele Paoloni
2025-07-01 21:58 ` Steven Rostedt
2025-07-02 14:16 ` Gabriele Paoloni
2025-06-12 10:43 ` [RFC PATCH 2/2] tracing: add testable specifications for event_enable_write/read Gabriele Paoloni
2025-07-01 22:11 ` Steven Rostedt
2025-07-02 14:59 ` Gabriele Paoloni
2025-07-02 15:12 ` Steven Rostedt [this message]
2025-07-02 16:12 ` Gabriele Paoloni
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=20250702111245.1fa23138@batman.local.home \
--to=rostedt@goodmis.org \
--cc=acarmina@redhat.com \
--cc=chuck.wolber@boeing.com \
--cc=gpaoloni@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®