From: Ian Rogers <irogers@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v1] libtraceevent: Avoid a simple asprintf case
Date: Thu, 16 May 2024 15:09:40 -0700 [thread overview]
Message-ID: <CAP-5=fUYxxmH8X0RVhdSWzKFT+WJO_UDULCtO4PK+VO-osXwGA@mail.gmail.com> (raw)
In-Reply-To: <20240516180248.24aa5aeb@rorschach.local.home>
On Thu, May 16, 2024 at 3:03 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Wed, 8 May 2024 22:13:17 -0700
> Ian Rogers <irogers@google.com> wrote:
>
> > Avoid an asprintf for the single character TEP_EVENT_NEWLINE and
> > TEP_EVENT_DELIM case.
>
> This states what the patch does, but omits why. What's wrong with
> asprintf() here?
Nothing except overhead. I was tracking down an asprintf issue [1],
asprintf breaking the sanitizer stack traces on my debian based linux,
and using asprintf for the sake of copying a character was creating a
huge amount of noise for me. 2 lines-of-code extra means this change
is by one measure more complex but it removes special knowledge of
asprintf return values and the meaning of %c, so on the other hand it
is less complex. I won't be offended if it's not accepted.
Thanks,
Ian
[1] https://lore.kernel.org/lkml/20240509052015.1914670-1-irogers@google.com/
> -- Steve
next prev parent reply other threads:[~2024-05-16 22:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 5:13 [PATCH v1] libtraceevent: Avoid a simple asprintf case Ian Rogers
2024-05-16 22:02 ` Steven Rostedt
2024-05-16 22:09 ` Ian Rogers [this message]
2024-05-16 23:51 ` Steven Rostedt
2024-05-28 15:51 ` Ian Rogers
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='CAP-5=fUYxxmH8X0RVhdSWzKFT+WJO_UDULCtO4PK+VO-osXwGA@mail.gmail.com' \
--to=irogers@google.com \
--cc=linux-trace-devel@vger.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).