libtraceevent: Avoid a simple asprintf case

The asprintf function can cause some noticeable overhead[1] and using
it for allocating just two characters is a little expensive.
Avoid the asprintf for the single character TEP_EVENT_NEWLINE and
TEP_EVENT_DELIM case.

[1] https://lore.kernel.org/lkml/20240509052015.1914670-1-irogers@google.com/

Link: https://lore.kernel.org/linux-trace-devel/20240509051317.1913001-1-irogers@google.com

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed