[lttng-dev] [PATCH v2] Improve tracef/tracelog to use the stack for small strings

2022-08-01 Thread Norbert Lange via lttng-dev
From: Norbert Lange 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

[lttng-dev] [PATCH v2 2/2] lttng_ust_init_thread: call urcu_register_thread

2022-08-01 Thread Norbert Lange via lttng-dev
From: Norbert Lange Eagerly register the thread, and avoid taking mutex during the first tracepoint. Signed-off-by: Norbert Lange Acked-by: Mathieu Desnoyers --- src/lib/lttng-ust/lttng-ust-comm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/lttng-ust/lttng-ust-comm.c b/src/

[lttng-dev] [PATCH v2 1/2] lttng_ust_init_thread: initialise cached context values

2022-08-01 Thread Norbert Lange via lttng-dev
From: Norbert Lange Modify all relevant *_alloc_tls functions so that they take flags for 'init'. Rename them to init_thread for consistency. So far define one flag LTTNG_UST_INIT_THREAD_CONTEXT_CACHE, this will warm up cached values so less is done during the first tracepoint. The function 'lt

Re: [lttng-dev] [PATCH v2] Improve tracef/tracelog to use the stack for small strings

2022-08-01 Thread Norbert Lange via lttng-dev
Am Mo., 1. Aug. 2022 um 16:35 Uhr schrieb Norbert Lange : > > From: Norbert Lange > > 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_l

Re: [lttng-dev] [PATCH v2 1/2] lttng_ust_init_thread: initialise cached context values

2022-08-01 Thread Mathieu Desnoyers via lttng-dev
- On Aug 1, 2022, at 10:36 AM, Norbert Lange via lttng-dev lttng-dev@lists.lttng.org wrote: > #else /* #ifdef HAVE_LINUX_PERF_EVENT_H */ > static inline > -void lttng_ust_perf_counter_alloc_tls(void) > +void lttng_ust_perf_counter_init_thread(int flags) Using void lttng_ust_perf_counter_in

Re: [lttng-dev] [PATCH v2] Improve tracef/tracelog to use the stack for small strings

2022-08-01 Thread Mathieu Desnoyers via lttng-dev
- On Aug 1, 2022, at 10:35 AM, Norbert Lange via lttng-dev lttng-dev@lists.lttng.org wrote: > From: Norbert Lange > > 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")' sche

Re: [lttng-dev] [PATCH v2 2/2] lttng_ust_init_thread: call urcu_register_thread

2022-08-01 Thread Mathieu Desnoyers via lttng-dev
- On Aug 1, 2022, at 10:37 AM, Norbert Lange nolang...@gmail.com wrote: > From: Norbert Lange > > Eagerly register the thread, and avoid taking mutex during the > first tracepoint. Merged, thanks! Mathieu > > Signed-off-by: Norbert Lange > Acked-by: Mathieu Desnoyers > --- > src/lib/lt

Re: [lttng-dev] [PATCH v2] Improve tracef/tracelog to use the stack for small strings

2022-08-01 Thread Mathieu Desnoyers via lttng-dev
- On Aug 1, 2022, at 10:44 AM, Norbert Lange via lttng-dev lttng-dev@lists.lttng.org wrote: [...] > > Any chance of not having to link liblttng-ust for the tracelog/tracef > functions, > like all other tracepoints (only hard dependency on liblttng-ust-tracepoint)? > My involvement is limited