X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libustctl%2Fustctl.c;h=27ba0e5f3fa48f36b6e6c3d32c27237a53d9ca21;hb=4a6ca0580b89f57b5c765bace547f70d619c4e9d;hp=e0b7edafdb39ad07035a7558a89fb8d98ffb5565;hpb=e41474be35fb9a706872316b06127d108b86b617;p=lttng-ust.git diff --git a/libustctl/ustctl.c b/libustctl/ustctl.c index e0b7edaf..27ba0e5f 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. */ @@ -326,14 +352,20 @@ int ustctl_disable(int sock, struct object_data *object) return 0; } -int ustctl_start_session(int sock, struct object_data *object) +int ustctl_start_session(int sock, int handle) { - return ustctl_enable(sock, object); + struct object_data obj; + + obj.handle = handle; + return ustctl_enable(sock, &obj); } -int ustctl_stop_session(int sock, struct object_data *object) +int ustctl_stop_session(int sock, int handle) { - return ustctl_disable(sock, object); + struct object_data obj; + + obj.handle = handle; + return ustctl_disable(sock, &obj); } @@ -375,6 +407,17 @@ int ustctl_wait_quiescent(int sock) return 0; } +int ustctl_flush_buffer(int sock, struct object_data *channel_data) +{ + struct ustcomm_ust_msg lum; + struct ustcomm_ust_reply lur; + + memset(&lum, 0, sizeof(lum)); + lum.handle = channel_data->handle; + lum.cmd = LTTNG_UST_FLUSH_BUFFER; + return ustcomm_send_app_cmd(sock, &lum, &lur); +} + int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate) { return -ENOSYS;