From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
Masami Hiramatsu <mhiramat@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-trace-kernel@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH v1 1/1] f2fs: Use return value of strreplace()
Date: Mon, 10 Jul 2023 18:58:09 -0700 [thread overview]
Message-ID: <ZKy3MQ4zRlvLwE1D@google.com> (raw)
In-Reply-To: <20230710184353.09640aee@gandalf.local.home>
On 07/10, Steven Rostedt wrote:
> On Wed, 28 Jun 2023 18:02:43 +0300
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
> > Since strreplace() returns the pointer to the string itself,
> > we may use it directly in the code.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > include/trace/events/f2fs.h | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> > index 793f82cc1515..f5994515290c 100644
> > --- a/include/trace/events/f2fs.h
> > +++ b/include/trace/events/f2fs.h
> > @@ -2234,13 +2234,11 @@ DECLARE_EVENT_CLASS(f2fs__rw_start,
> > * because this screws up the tooling that parses
> > * the traces.
> > */
> > - __assign_str(pathbuf, pathname);
> > - (void)strreplace(__get_str(pathbuf), ' ', '_');
> > + __assign_str(pathbuf, strreplace(pathname, ' ', '_'));
>
> But this modifies the pathname that is passed into the trace event, which
> is something that a trace point should never do! In fact, the char
> *pathname, really should be a const char * (for which this would fail to
> build).
>
> Note, I went to look for these events and I can not find where they are
> used. Should these events just be deleted?
Hmm, this was a part of upstream effort to replace the previous android_fs
tracepoints like:
https://android-review.git.corp.google.com/c/platform/system/extras/+/2223339
>
> -- Steve
>
>
> > __entry->offset = offset;
> > __entry->bytes = bytes;
> > __entry->i_size = i_size_read(inode);
> > - __assign_str(cmdline, command);
> > - (void)strreplace(__get_str(cmdline), ' ', '_');
> > + __assign_str(cmdline, strreplace(command, ' ', '_'));
> > __entry->pid = pid;
> > __entry->ino = inode->i_ino;
> > ),
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Chao Yu <chao@kernel.org>,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH v1 1/1] f2fs: Use return value of strreplace()
Date: Mon, 10 Jul 2023 18:58:09 -0700 [thread overview]
Message-ID: <ZKy3MQ4zRlvLwE1D@google.com> (raw)
In-Reply-To: <20230710184353.09640aee@gandalf.local.home>
On 07/10, Steven Rostedt wrote:
> On Wed, 28 Jun 2023 18:02:43 +0300
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
> > Since strreplace() returns the pointer to the string itself,
> > we may use it directly in the code.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > include/trace/events/f2fs.h | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> > index 793f82cc1515..f5994515290c 100644
> > --- a/include/trace/events/f2fs.h
> > +++ b/include/trace/events/f2fs.h
> > @@ -2234,13 +2234,11 @@ DECLARE_EVENT_CLASS(f2fs__rw_start,
> > * because this screws up the tooling that parses
> > * the traces.
> > */
> > - __assign_str(pathbuf, pathname);
> > - (void)strreplace(__get_str(pathbuf), ' ', '_');
> > + __assign_str(pathbuf, strreplace(pathname, ' ', '_'));
>
> But this modifies the pathname that is passed into the trace event, which
> is something that a trace point should never do! In fact, the char
> *pathname, really should be a const char * (for which this would fail to
> build).
>
> Note, I went to look for these events and I can not find where they are
> used. Should these events just be deleted?
Hmm, this was a part of upstream effort to replace the previous android_fs
tracepoints like:
https://android-review.git.corp.google.com/c/platform/system/extras/+/2223339
>
> -- Steve
>
>
> > __entry->offset = offset;
> > __entry->bytes = bytes;
> > __entry->i_size = i_size_read(inode);
> > - __assign_str(cmdline, command);
> > - (void)strreplace(__get_str(cmdline), ' ', '_');
> > + __assign_str(cmdline, strreplace(command, ' ', '_'));
> > __entry->pid = pid;
> > __entry->ino = inode->i_ino;
> > ),
next prev parent reply other threads:[~2023-07-11 1:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 15:02 [f2fs-dev] [PATCH v1 1/1] f2fs: Use return value of strreplace() Andy Shevchenko
2023-06-28 15:02 ` Andy Shevchenko
2023-07-10 22:43 ` [f2fs-dev] " Steven Rostedt
2023-07-10 22:43 ` Steven Rostedt
2023-07-11 1:58 ` Jaegeuk Kim [this message]
2023-07-11 1:58 ` Jaegeuk Kim
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=ZKy3MQ4zRlvLwE1D@google.com \
--to=jaegeuk@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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.