From: Joe Perches <joe@perches.com>
To: Steven Rostedt <rostedt@goodmis.org>, Tom Zanussi <zanussi@kernel.org>
Cc: tglx@linutronix.de, mhiramat@kernel.org, namhyung@kernel.org,
vedang.patel@intel.com, bigeasy@linutronix.de,
joel@joelfernandes.org, mathieu.desnoyers@efficios.com,
julia@ni.com, linux-kernel@vger.kernel.org,
linux-rt-users@vger.kernel.org
Subject: Re: [PATCH 2/7] tracing: Change strlen to sizeof for hist trigger static strings
Date: Wed, 19 Dec 2018 13:08:20 -0800 [thread overview]
Message-ID: <0c78a59b1dcb05237f35bb9c9714debfa96680c7.camel@perches.com> (raw)
In-Reply-To: <20181219160138.447a4bb0@gandalf.local.home>
On Wed, 2018-12-19 at 16:01 -0500, Steven Rostedt wrote:
> On Wed, 19 Dec 2018 14:38:39 -0600
> Tom Zanussi <zanussi@kernel.org> wrote:
>
> > On Wed, 2018-12-19 at 15:30 -0500, Steven Rostedt wrote:
> > > On Wed, 19 Dec 2018 12:20:19 -0800
> > > Joe Perches <joe@perches.com> wrote:
> > >
> > > > > Yeah, I had considered it but wasn't sure it was worth it. Since
> > > > > you're suggesting it is, I can send another patch on top of
> > > > > these, or
> > > > > feel free if you want to too. ;-)
> > > >
> > > > I believe the 'strlen("foo") -> sizeof("foo") - 1'
> > > > conversions do not change objects at all.
> > > >
> > > > strlen("constant") is already optimized by gcc to a
> > > > constant value when fed a constant string.
> > >
> > > If that's the case (and it probably is), then yeah, strlen is
> > > probably
> > > better. As it can handle the "not a constant" that you stated in
> > > another email.
> > >
> >
> > OK, so I guess that means we should just drop this patch ('[PATCH 2/7]
> > tracing: Change strlen to sizeof for hist trigger static strings').
> >
>
> No, that patch is fine, the macro was not. I've already applied your
> patch set. Just need to run it through my tests.
The patch included:
- start += strlen("char[");
+ start += sizeof("char[") - 1;
So, that 2/7 patch is unnecessary as there is no object code
change and using 'sizeof("const") - 1' is less intelligible
than strlen("const")
If you convert the strncmp(ptr, "const", strlen("const"))
uses to strncmp_prefix(ptr, "const") eventually, the patch
just makes more variations to change.
next prev parent reply other threads:[~2018-12-19 21:08 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 20:33 [PATCH 0/7] tracing: Hist trigger var-ref cleanup and comments Tom Zanussi
2018-12-18 20:33 ` [PATCH 1/7] tracing: Remove unnecessary hist trigger struct field Tom Zanussi
2018-12-18 20:33 ` [PATCH 2/7] tracing: Change strlen to sizeof for hist trigger static strings Tom Zanussi
2018-12-19 19:40 ` Steven Rostedt
2018-12-19 19:46 ` Tom Zanussi
2018-12-19 20:16 ` Tom Zanussi
2018-12-19 20:22 ` Joe Perches
2018-12-19 20:34 ` Steven Rostedt
2018-12-19 20:51 ` Joe Perches
2018-12-19 21:03 ` Steven Rostedt
2018-12-19 20:28 ` Steven Rostedt
2018-12-19 20:20 ` Joe Perches
2018-12-19 20:30 ` Steven Rostedt
2018-12-19 20:38 ` Tom Zanussi
2018-12-19 21:01 ` Steven Rostedt
2018-12-19 21:08 ` Joe Perches [this message]
2018-12-19 20:27 ` Steven Rostedt
2018-12-18 20:33 ` [PATCH 3/7] tracing: Use var_refs[] for hist trigger reference checking Tom Zanussi
2018-12-19 12:22 ` Masami Hiramatsu
2018-12-19 15:01 ` Tom Zanussi
2018-12-19 15:36 ` Steven Rostedt
2018-12-19 19:08 ` Tom Zanussi
2018-12-19 19:09 ` [PATCH v2 " Tom Zanussi
2018-12-18 20:33 ` [PATCH 4/7] tracing: Remove open-coding of hist trigger var_ref management Tom Zanussi
2018-12-18 20:33 ` [PATCH 5/7] tracing: Use hist trigger's var_ref array to destroy var_refs Tom Zanussi
2018-12-18 20:33 ` [PATCH 6/7] tracing: Remove hist trigger synth_var_refs Tom Zanussi
2018-12-18 20:33 ` [PATCH 7/7] tracing: Add hist trigger comments for variable-related fields Tom Zanussi
2018-12-19 11:45 ` [PATCH 0/7] tracing: Hist trigger var-ref cleanup and comments Namhyung Kim
2018-12-19 15:00 ` Tom Zanussi
2018-12-19 12:27 ` Masami Hiramatsu
2018-12-19 15:02 ` Tom Zanussi
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=0c78a59b1dcb05237f35bb9c9714debfa96680c7.camel@perches.com \
--to=joe@perches.com \
--cc=bigeasy@linutronix.de \
--cc=joel@joelfernandes.org \
--cc=julia@ni.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=namhyung@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=vedang.patel@intel.com \
--cc=zanussi@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;
as well as URLs for NNTP newsgroup(s).