* this function.
*/
static
-void delete_ust_app_stream(int sock, struct ltt_ust_stream *stream)
+void delete_ust_app_stream(int sock, struct ust_app_stream *stream)
{
if (stream->obj) {
ustctl_release_object(sock, stream->obj);
struct lttng_ht_iter iter;
struct ust_app_event *ua_event;
struct ust_app_ctx *ua_ctx;
- struct ltt_ust_stream *stream, *stmp;
+ struct ust_app_stream *stream, *stmp;
/* Wipe stream */
cds_list_for_each_entry_safe(stream, stmp, &ua_chan->streams.head, list) {
return NULL;
}
+/*
+ * Allocate and initialize a UST app stream.
+ *
+ * Return newly allocated stream pointer or NULL on error.
+ */
+static struct ust_app_stream *alloc_ust_app_stream(void)
+{
+ struct ust_app_stream *stream = NULL;
+
+ stream = zmalloc(sizeof(*stream));
+ if (stream == NULL) {
+ PERROR("zmalloc ust app stream");
+ goto error;
+ }
+
+ /* Zero could be a valid value for a handle so flag it to -1. */
+ stream->handle = -1;
+
+error:
+ return stream;
+}
+
/*
* Alloc new UST app event.
*/
* On error, return a negative value.
*/
static int create_ust_stream(struct ust_app *app,
- struct ust_app_channel *ua_chan, struct ltt_ust_stream *stream)
+ struct ust_app_channel *ua_chan, struct ust_app_stream *stream)
{
int ret;
struct lttng_ht_iter iter;
struct ust_app_session *ua_sess;
struct ust_app_channel *ua_chan;
- struct ltt_ust_stream *ustream;
+ struct ust_app_stream *ustream;
struct consumer_socket *socket;
DBG("Starting tracing for ust app pid %d", app->pid);
/* Create all streams */
while (1) {
/* Create UST stream */
- ustream = zmalloc(sizeof(*ustream));
+ ustream = alloc_ust_app_stream();
if (ustream == NULL) {
- PERROR("zmalloc ust stream");
goto error_rcu_unlock;
}