sessiond: ust-app: close the event notifier group's pipe write-end
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 21 Jan 2021 17:28:59 +0000 (12:28 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 28 Jan 2021 23:32:40 +0000 (18:32 -0500)
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 <jeremie.galarneau@efficios.com>
Change-Id: Ic8f016bc4cdd3dce2d7ea8ac9cccb53e3b69c5b0

src/bin/lttng-sessiond/ust-app.c

index a1891d805e801e19599c69a4d22374465ff62498..38d1d78713e6446dca9b55b001ccfbee376c88b3 100644 (file)
@@ -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),
This page took 0.035729 seconds and 4 git commands to generate.