Re: [PATCH v1] libtraceevent: Avoid a simple asprintf case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 16, 2024 at 3:03 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Wed,  8 May 2024 22:13:17 -0700
> Ian Rogers <irogers@xxxxxxxxxx> 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@xxxxxxxxxx/

> -- Steve





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux