Improve tracef/tracelog to use the stack for small strings
authorNorbert Lange <nolange79@gmail.com>
Mon, 1 Aug 2022 14:35:24 +0000 (16:35 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 1 Aug 2022 15:07:02 +0000 (11:07 -0400)
commit1c0569ec0d094571d181d1fce53ecfce8877614f
tree9c44b0e29277a3f365e5b6fd1ce1520f6bc05333
parent85f8af7b80f5d52ab099e7f73d3ac8f59c6bb1e9
Improve tracef/tracelog to use the stack for small strings

Support two common cases, one being that the resulting message is
small enough to fit into a on-stack buffer.
The seconds being the common 'printf("%s", "Message")' scheme.

Unfortunately, iterating a va_list is destructive,
so it has to be copied before calling vprintf.

The implementation was moved to a separate file,
used by both tracef.c and tracelog.c.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/common/tracer.h
src/lib/lttng-ust/tracef.c
src/lib/lttng-ust/tracelog-internal.h [new file with mode: 0644]
src/lib/lttng-ust/tracelog.c
This page took 0.025068 seconds and 4 git commands to generate.