From: Mathieu Desnoyers Date: Mon, 19 Nov 2018 21:13:58 +0000 (-0500) Subject: Fix: sessiond: don't allocate buffers and files for inactive sessions X-Git-Tag: v2.12.0-rc1~684 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=0498a00cbc6b5b40609016d0c5e695cd50efc01f;hp=0498a00cbc6b5b40609016d0c5e695cd50efc01f;p=lttng-tools.git Fix: sessiond: don't allocate buffers and files for inactive sessions When tracing is inactive (before start/after stop), the current behavior is to track all applications registered as UST data producers and allocate buffers and files. However, we guarantee that the trace is readable (invariant) after a "stop" command has waited for data pending to complete. Unfortunately, tracking additional applications (and adding their files) after tracing is stopped (for each pid in per-pid buffers, for new uid in per-uid buffers) does not respect this guarantee. Fix this by *not* allocating channels, events, contexts when tracing is inactive, but rather allocate those lazily just before tracing starts. One reason why this was not originally done was to ensure we could have a fast start command. There are however other ways to achieve this in the future that will respect the stop invariant guarantees. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau ---