add ustctl_release_handle
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 11 Dec 2011 16:32:20 +0000 (11:32 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 11 Dec 2011 16:32:20 +0000 (11:32 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-ctl.h
liblttng-ust-ctl/ustctl.c

index 0f8aa835151ea710fedb133ee1d406ab3b257e48..47c78b74e08b91535728fb1ffc31bcfd0474f223 100644 (file)
@@ -131,7 +131,9 @@ void ustctl_flush_buffer(struct lttng_ust_shm_handle *handle,
                struct lttng_ust_lib_ring_buffer *buf,
                int producer_active);
 
-/* Release object created by members of this API */
+/* Release object created by members of this API. */
 int ustctl_release_object(int sock, struct lttng_ust_object_data *data);
+/* Release handle returned by create session. */
+int ustctl_release_handle(int sock, int handle);
 
 #endif /* _LTTNG_UST_CTL_H */
index 13100aebdcda0ba4f3b7aacc4242846e9e9c0937..5405418ccab632e204d1a2603413fa2a4a903a89 100644 (file)
@@ -40,6 +40,23 @@ void init_object(struct lttng_ust_object_data *data)
        data->memory_map_size = 0;
 }
 
+int ustctl_release_handle(int sock, int handle)
+{
+       struct ustcomm_ust_msg lum;
+       struct ustcomm_ust_reply lur;
+       int ret;
+
+       if (sock >= 0) {
+               memset(&lum, 0, sizeof(lum));
+               lum.handle = handle;
+               lum.cmd = LTTNG_UST_RELEASE;
+               ret = ustcomm_send_app_cmd(sock, &lum, &lur);
+               if (ret < 0) {
+                       return ret;
+               }
+       }
+       return 0;
+}
 /*
  * If sock is negative, it means we don't have to notify the other side
  * (e.g. application has already vanished).
@@ -62,16 +79,7 @@ int ustctl_release_object(int sock, struct lttng_ust_object_data *data)
                        return ret;
                }
        }
-       if (sock >= 0) {
-               memset(&lum, 0, sizeof(lum));
-               lum.handle = data->handle;
-               lum.cmd = LTTNG_UST_RELEASE;
-               ret = ustcomm_send_app_cmd(sock, &lum, &lur);
-               if (ret < 0) {
-                       return ret;
-               }
-       }
-       return 0;
+       return ustctl_release_handle(sock, data->handle);
 }
 
 /*
This page took 0.026096 seconds and 4 git commands to generate.