From 5d4193fd103743e68020148db71469b907020140 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 21 Jan 2021 12:28:59 -0500 Subject: [PATCH] sessiond: ust-app: close the event notifier group's pipe write-end MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The write-end of the event notifier group's pipe can be closed after it is passed to the application. This reduces the amount of file descriptors used by the session daemon on a per-application basis. Signed-off-by: Jérémie Galarneau Change-Id: Ic8f016bc4cdd3dce2d7ea8ac9cccb53e3b69c5b0 --- src/bin/lttng-sessiond/ust-app.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index a1891d805..38d1d7871 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -3885,6 +3885,13 @@ int ust_app_setup_event_notifier_group(struct ust_app *app) goto error; } + ret = lttng_pipe_write_close(app->event_notifier_group.event_pipe); + if (ret) { + ERR("Failed to close write end of the application's event source pipe: app = '%s' (ppid = %d)", + app->name, app->ppid); + goto error; + } + lttng_ret = notification_thread_command_add_tracer_event_source( notification_thread_handle, lttng_pipe_get_readfd(app->event_notifier_group.event_pipe), -- 2.34.1