From 1c5e467e5da8d549fa499c3ceb9739c5f704260d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 23 Oct 2011 17:38:05 -0400 Subject: [PATCH] Implement ustctl_register_done Signed-off-by: Mathieu Desnoyers --- include/ust/lttng-ust-ctl.h | 1 + libustctl/ustctl.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/include/ust/lttng-ust-ctl.h b/include/ust/lttng-ust-ctl.h index ea3d0301..ddadd61e 100644 --- a/include/ust/lttng-ust-ctl.h +++ b/include/ust/lttng-ust-ctl.h @@ -41,6 +41,7 @@ struct object_data { uint64_t memory_map_size; }; +int ustctl_register_done(int sock); int ustctl_create_session(int sock); int ustctl_open_metadata(int sock, int session_handle, struct lttng_ust_channel_attr *chops, diff --git a/libustctl/ustctl.c b/libustctl/ustctl.c index e0b7edaf..cec7e24c 100644 --- a/libustctl/ustctl.c +++ b/libustctl/ustctl.c @@ -55,6 +55,32 @@ void release_object(int sock, struct object_data *data) free(data); } +/* + * Send registration done packet to the application. + */ +int ustctl_register_done(int sock) +{ + struct ustcomm_ust_msg lum; + struct ustcomm_ust_reply lur; + int ret; + + DBG("Sending register done command to %d", sock); + memset(&lum, 0, sizeof(lum)); + lum.handle = LTTNG_UST_ROOT_HANDLE; + lum.cmd = LTTNG_UST_REGISTER_DONE; + ret = ustcomm_send_app_cmd(sock, &lum, &lur); + if (ret) + return ret; + if (lur.ret_code != USTCOMM_OK) { + DBG("Return code: %s", ustcomm_get_readable_code(lur.ret_code)); + goto error; + } + return 0; + +error: + return -1; +} + /* * returns session handle. */ -- 2.34.1