standardize on flush buffer (no plural)
[lttng-ust.git] / libustctl / ustctl.c
index abe6d034bb4211f7941da8dcec40cb4a56325cbc..50357645dd18ca0153c3025360a1ad0c2c137e1a 100644 (file)
 #include <ust/lttng-ust-ctl.h>
 #include <ust/lttng-ust-abi.h>
 #include <ust/usterr-signal-safe.h>
-#include "lttng-ust-comm.h"
+#include <ust/lttng-ust-comm.h>
 
 #include "../libringbuffer/backend.h"
 #include "../libringbuffer/frontend.h"
 
+volatile enum ust_loglevel ust_loglevel;
+
 static
 void init_object(struct object_data *data)
 {
@@ -53,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.
  */
@@ -373,6 +401,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;
@@ -479,6 +518,12 @@ void ustctl_close_stream_read(struct shm_handle *handle,
 
 /* For mmap mode, readable without "get" operation */
 
+void *ustctl_get_mmap_base(struct shm_handle *handle,
+               struct lib_ring_buffer *buf)
+{
+       return shmp(handle, buf->backend.memory_map);
+}
+
 /* returns the length to mmap. */
 int ustctl_get_mmap_len(struct shm_handle *handle,
                struct lib_ring_buffer *buf,
This page took 0.025568 seconds and 4 git commands to generate.