rcu_read_lock();
/* Delete ust app sessions info */
- sock = app->key.sock;
- app->key.sock = -1;
+ sock = app->sock;
+ app->sock = -1;
/* Wipe sessions */
cds_lfht_for_each_entry(app->sessions->ht, &iter.iter, ua_sess,
node.node) {
ret = lttng_ht_del(app->sessions, &iter);
assert(!ret);
- delete_ust_app_session(app->key.sock, ua_sess);
+ delete_ust_app_session(app->sock, ua_sess);
}
lttng_ht_destroy(app->sessions);
/*
- * Wait until we have removed the key from the sock hash table before
- * closing this socket, otherwise an application could re-use the socket ID
- * and race with the teardown, using the same hash table entry.
+ * Wait until we have deleted the application from the sock hash table
+ * before closing this socket, otherwise an application could re-use the
+ * socket ID and race with the teardown, using the same hash table entry.
+ *
+ * It's OK to leave the close in call_rcu. We want it to stay unique for
+ * all RCU readers that could run concurrently with unregister app,
+ * therefore we _need_ to only close that socket after a grace period. So
+ * it should stay in this RCU callback.
+ *
+ * This close() is a very important step of the synchronization model so
+ * every modification to this function must be carefully reviewed.
*/
ret = close(sock);
if (ret) {
PERROR("close");
}
- DBG2("UST app pid %d deleted", app->key.pid);
+ DBG2("UST app pid %d deleted", app->pid);
free(app);
rcu_read_unlock();
struct lttng_ht_node_ulong *node =
caa_container_of(head, struct lttng_ht_node_ulong, head);
struct ust_app *app =
- caa_container_of(node, struct ust_app, node);
+ caa_container_of(node, struct ust_app, pid_n);
- DBG3("Call RCU deleting app PID %d", app->key.pid);
+ DBG3("Call RCU deleting app PID %d", app->pid);
delete_ust_app(app);
}
struct ust_app *find_app_by_sock(int sock)
{
struct lttng_ht_node_ulong *node;
- struct ust_app_key *key;
struct lttng_ht_iter iter;
- lttng_ht_lookup(ust_app_sock_key_map, (void *)((unsigned long) sock),
- &iter);
- node = lttng_ht_iter_get_node_ulong(&iter);
- if (node == NULL) {
- DBG2("UST app find by sock %d key not found", sock);
- goto error;
- }
- key = caa_container_of(node, struct ust_app_key, node);
-
- lttng_ht_lookup(ust_app_ht, (void *)((unsigned long) key->pid), &iter);
+ lttng_ht_lookup(ust_app_ht_by_sock, (void *)((unsigned long) sock), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
if (node == NULL) {
DBG2("UST app find by sock %d not found", sock);
goto error;
}
- return caa_container_of(node, struct ust_app, node);
+
+ return caa_container_of(node, struct ust_app, sock_n);
error:
return NULL;
{
int ret;
- ret = ustctl_add_context(app->key.sock, &ua_ctx->ctx,
+ ret = ustctl_add_context(app->sock, &ua_ctx->ctx,
ua_chan->obj, &ua_ctx->obj);
if (ret < 0) {
goto error;
{
int ret;
- ret = ustctl_add_context(app->key.sock, &ua_ctx->ctx,
+ ret = ustctl_add_context(app->sock, &ua_ctx->ctx,
ua_event->obj, &ua_ctx->obj);
if (ret < 0) {
goto error;
{
int ret;
- ret = ustctl_disable(app->key.sock, ua_event->obj);
+ ret = ustctl_disable(app->sock, ua_event->obj);
if (ret < 0) {
ERR("UST app event %s disable failed for app (pid: %d) "
"and session handle %d with ret %d",
- ua_event->attr.name, app->key.pid, ua_sess->handle, ret);
+ ua_event->attr.name, app->pid, ua_sess->handle, ret);
goto error;
}
DBG2("UST app event %s disabled successfully for app (pid: %d)",
- ua_event->attr.name, app->key.pid);
+ ua_event->attr.name, app->pid);
error:
return ret;
{
int ret;
- ret = ustctl_disable(app->key.sock, ua_chan->obj);
+ ret = ustctl_disable(app->sock, ua_chan->obj);
if (ret < 0) {
ERR("UST app channel %s disable failed for app (pid: %d) "
"and session handle %d with ret %d",
- ua_chan->name, app->key.pid, ua_sess->handle, ret);
+ ua_chan->name, app->pid, ua_sess->handle, ret);
goto error;
}
DBG2("UST app channel %s disabled successfully for app (pid: %d)",
- ua_chan->name, app->key.pid);
+ ua_chan->name, app->pid);
error:
return ret;
{
int ret;
- ret = ustctl_enable(app->key.sock, ua_chan->obj);
+ ret = ustctl_enable(app->sock, ua_chan->obj);
if (ret < 0) {
ERR("UST app channel %s enable failed for app (pid: %d) "
"and session handle %d with ret %d",
- ua_chan->name, app->key.pid, ua_sess->handle, ret);
+ ua_chan->name, app->pid, ua_sess->handle, ret);
goto error;
}
ua_chan->enabled = 1;
DBG2("UST app channel %s enabled successfully for app (pid: %d)",
- ua_chan->name, app->key.pid);
+ ua_chan->name, app->pid);
error:
return ret;
{
int ret;
- ret = ustctl_enable(app->key.sock, ua_event->obj);
+ ret = ustctl_enable(app->sock, ua_event->obj);
if (ret < 0) {
ERR("UST app event %s enable failed for app (pid: %d) "
"and session handle %d with ret %d",
- ua_event->attr.name, app->key.pid, ua_sess->handle, ret);
+ ua_event->attr.name, app->pid, ua_sess->handle, ret);
goto error;
}
DBG2("UST app event %s enabled successfully for app (pid: %d)",
- ua_event->attr.name, app->key.pid);
+ ua_event->attr.name, app->pid);
error:
return ret;
uattr.output = ua_sess->metadata->attr.output;
/* UST tracer metadata creation */
- ret = ustctl_open_metadata(app->key.sock, ua_sess->handle, &uattr,
+ ret = ustctl_open_metadata(app->sock, ua_sess->handle, &uattr,
&ua_sess->metadata->obj);
if (ret < 0) {
ERR("UST app open metadata failed for app pid:%d with ret %d",
- app->key.pid, ret);
+ app->pid, ret);
goto error;
}
{
int ret;
- ret = ustctl_create_stream(app->key.sock, ua_sess->metadata->obj,
+ ret = ustctl_create_stream(app->sock, ua_sess->metadata->obj,
&ua_sess->metadata->stream_obj);
if (ret < 0) {
ERR("UST create metadata stream failed");
int ret;
/* TODO: remove cast and use lttng-ust-abi.h */
- ret = ustctl_create_channel(app->key.sock, ua_sess->handle,
+ ret = ustctl_create_channel(app->sock, ua_sess->handle,
(struct lttng_ust_channel_attr *)&ua_chan->attr, &ua_chan->obj);
if (ret < 0) {
ERR("Creating channel %s for app (pid: %d, sock: %d) "
"and session handle %d with ret %d",
- ua_chan->name, app->key.pid, app->key.sock,
+ ua_chan->name, app->pid, app->sock,
ua_sess->handle, ret);
goto error;
}
ua_chan->handle = ua_chan->obj->handle;
DBG2("UST app channel %s created successfully for pid:%d and sock:%d",
- ua_chan->name, app->key.pid, app->key.sock);
+ ua_chan->name, app->pid, app->sock);
/* If channel is not enabled, disable it on the tracer */
if (!ua_chan->enabled) {
int ret = 0;
/* Create UST event on tracer */
- ret = ustctl_create_event(app->key.sock, &ua_event->attr, ua_chan->obj,
+ ret = ustctl_create_event(app->sock, &ua_event->attr, ua_chan->obj,
&ua_event->obj);
if (ret < 0) {
if (ret == -EEXIST) {
goto error;
}
ERR("Error ustctl create event %s for app pid: %d with ret %d",
- ua_event->attr.name, app->key.pid, ret);
+ ua_event->attr.name, app->pid, ret);
goto error;
}
ua_event->handle = ua_event->obj->handle;
DBG2("UST app event %s created successfully for pid:%d",
- ua_event->attr.name, app->key.pid);
+ ua_event->attr.name, app->pid);
/* If event not enabled, disable it on the tracer */
if (ua_event->enabled == 0) {
ua_sess->gid = usess->gid;
ret = snprintf(ua_sess->path, PATH_MAX, "%s/%s-%d-%s", usess->pathname,
- app->name, app->key.pid, datetime);
+ app->name, app->pid, datetime);
if (ret < 0) {
PERROR("asprintf UST shadow copy session");
/* TODO: We cannot return an error from here.. */
ua_sess = lookup_session_by_app(usess, app);
if (ua_sess == NULL) {
DBG2("UST app pid: %d session id %d not found, creating it",
- app->key.pid, usess->id);
+ app->pid, usess->id);
ua_sess = alloc_ust_app_session();
if (ua_sess == NULL) {
/* Only malloc can failed so something is really wrong */
}
if (ua_sess->handle == -1) {
- ret = ustctl_create_session(app->key.sock);
+ ret = ustctl_create_session(app->sock);
if (ret < 0) {
- ERR("Creating session for app pid %d", app->key.pid);
+ ERR("Creating session for app pid %d", app->pid);
/* This means that the tracer is gone... */
ua_sess = (void*) -1UL;
goto error;
lttng_ht_add_unique_str(ua_sess->channels, &ua_chan->node);
DBG2("UST app create channel %s for PID %d completed", ua_chan->name,
- app->key.pid);
+ app->pid);
end:
return ua_chan;
lttng_ht_add_unique_str(ua_chan->events, &ua_event->node);
DBG2("UST app create event %s for PID %d completed", ua_event->name,
- app->key.pid);
+ app->pid);
end:
return ret;
goto error;
}
- DBG2("UST metadata opened for app pid %d", app->key.pid);
+ DBG2("UST metadata opened for app pid %d", app->pid);
}
/* Open UST metadata stream */
}
DBG2("UST metadata stream object created for app pid %d",
- app->key.pid);
+ app->pid);
} else {
ERR("Attempting to create stream without metadata opened");
goto error;
DBG2("Found UST app by pid %d", pid);
- return caa_container_of(node, struct ust_app, node);
+ return caa_container_of(node, struct ust_app, pid_n);
error:
rcu_read_unlock();
lta->name[16] = '\0';
lta->sessions = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
- /* Set key map */
- lta->key.pid = msg->pid;
- lttng_ht_node_init_ulong(<a->node, (unsigned long)lta->key.pid);
- lta->key.sock = sock;
- lttng_ht_node_init_ulong(<a->key.node, (unsigned long)lta->key.sock);
+ lta->pid = msg->pid;
+ lttng_ht_node_init_ulong(<a->pid_n, (unsigned long)lta->pid);
+ lta->sock = sock;
+ lttng_ht_node_init_ulong(<a->sock_n, (unsigned long)lta->sock);
rcu_read_lock();
- lttng_ht_add_unique_ulong(ust_app_sock_key_map, <a->key.node);
- lttng_ht_add_unique_ulong(ust_app_ht, <a->node);
+
+ /*
+ * On a re-registration, we want to kick out the previous registration of
+ * that pid
+ */
+ lttng_ht_add_replace_ulong(ust_app_ht, <a->pid_n);
+
+ /*
+ * The socket _should_ be unique until _we_ call close. So, a add_unique
+ * for the ust_app_ht_by_sock is used which asserts fail if the entry was
+ * already in the table.
+ */
+ lttng_ht_add_unique_ulong(ust_app_ht_by_sock, <a->sock_n);
+
rcu_read_unlock();
DBG("App registered with pid:%d ppid:%d uid:%d gid:%d sock:%d name:%s"
- " (version %d.%d)", lta->key.pid, lta->ppid, lta->uid, lta->gid,
- lta->key.sock, lta->name, lta->v_major, lta->v_minor);
+ " (version %d.%d)", lta->pid, lta->ppid, lta->uid, lta->gid,
+ lta->sock, lta->name, lta->v_major, lta->v_minor);
return 0;
}
int ret;
rcu_read_lock();
- lta = find_app_by_sock(sock);
- if (lta == NULL) {
- ERR("Unregister app sock %d not found!", sock);
- goto error;
- }
-
- DBG("PID %d unregistering with sock %d", lta->key.pid, sock);
-
- /* Remove application from socket hash table */
- lttng_ht_lookup(ust_app_sock_key_map, (void *)((unsigned long) sock), &iter);
- ret = lttng_ht_del(ust_app_sock_key_map, &iter);
- assert(!ret);
/* Get the node reference for a call_rcu */
- lttng_ht_lookup(ust_app_ht, (void *)((unsigned long) lta->key.pid), &iter);
+ lttng_ht_lookup(ust_app_ht_by_sock, (void *)((unsigned long) sock), &iter);
node = lttng_ht_iter_get_node_ulong(&iter);
if (node == NULL) {
- ERR("Unable to find app sock %d by pid %d", sock, lta->key.pid);
+ ERR("Unable to find app by sock %d", sock);
goto error;
}
+ lta = caa_container_of(node, struct ust_app, sock_n);
+
+ DBG("PID %d unregistering with sock %d", lta->pid, sock);
+
/* Remove application from PID hash table */
+ ret = lttng_ht_del(ust_app_ht_by_sock, &iter);
+ assert(!ret);
+
+ /* Assign second node for deletion */
+ iter.iter.node = <a->pid_n.node;
+
ret = lttng_ht_del(ust_app_ht, &iter);
assert(!ret);
- call_rcu(&node->head, delete_ust_app_rcu);
+
+ /* Free memory */
+ call_rcu(<a->pid_n.head, delete_ust_app_rcu);
+
error:
rcu_read_unlock();
return;
rcu_read_lock();
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
struct lttng_ust_tracepoint_iter uiter;
if (!app->compatible) {
*/
continue;
}
- handle = ustctl_tracepoint_list(app->key.sock);
+ handle = ustctl_tracepoint_list(app->sock);
if (handle < 0) {
ERR("UST app list events getting handle failed for app pid %d",
- app->key.pid);
+ app->pid);
continue;
}
- while ((ret = ustctl_tracepoint_list_get(app->key.sock, handle,
+ while ((ret = ustctl_tracepoint_list_get(app->sock, handle,
&uiter)) != -ENOENT) {
if (count >= nbmem) {
DBG2("Reallocating event list from %zu to %zu entries", nbmem,
memcpy(tmp[count].name, uiter.name, LTTNG_UST_SYM_NAME_LEN);
tmp[count].loglevel = uiter.loglevel;
tmp[count].type = LTTNG_UST_TRACEPOINT;
- tmp[count].pid = app->key.pid;
+ tmp[count].pid = app->pid;
tmp[count].enabled = -1;
count++;
}
assert(!ret);
call_rcu(&node->head, delete_ust_app_rcu);
}
- /* Destroy is done only when the ht is empty */
- lttng_ht_destroy(ust_app_ht);
- cds_lfht_for_each_entry(ust_app_sock_key_map->ht, &iter.iter, node, node) {
- ret = lttng_ht_del(ust_app_sock_key_map, &iter);
+ /* Cleanup socket hash table */
+ cds_lfht_for_each_entry(ust_app_ht_by_sock->ht, &iter.iter, node, node) {
+ ret = lttng_ht_del(ust_app_ht_by_sock, &iter);
assert(!ret);
}
+
/* Destroy is done only when the ht is empty */
- lttng_ht_destroy(ust_app_sock_key_map);
+ lttng_ht_destroy(ust_app_ht);
+ lttng_ht_destroy(ust_app_ht_by_sock);
rcu_read_unlock();
}
void ust_app_ht_alloc(void)
{
ust_app_ht = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
- ust_app_sock_key_map = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
+ ust_app_ht_by_sock = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
}
/*
rcu_read_lock();
/* For every registered applications */
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
struct lttng_ht_iter uiter;
if (!app->compatible) {
/*
rcu_read_lock();
/* For every registered applications */
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
rcu_read_lock();
/* For all registered applications */
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
ua_chan_node = lttng_ht_iter_get_node_str(&uiter);
if (ua_chan_node == NULL) {
DBG2("Channel %s not found in session id %d for app pid %d."
- "Skipping", uchan->name, usess->id, app->key.pid);
+ "Skipping", uchan->name, usess->id, app->pid);
continue;
}
ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node);
ua_event_node = lttng_ht_iter_get_node_str(&uiter);
if (ua_event_node == NULL) {
DBG2("Event %s not found in channel %s for app pid %d."
- "Skipping", uevent->attr.name, uchan->name, app->key.pid);
+ "Skipping", uevent->attr.name, uchan->name, app->pid);
continue;
}
ua_event = caa_container_of(ua_event_node, struct ust_app_event, node);
rcu_read_lock();
/* For all registered applications */
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
rcu_read_lock();
/* For every registered applications */
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
rcu_read_lock();
/* For all registered applications */
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
ua_event_node = lttng_ht_iter_get_node_str(&uiter);
if (ua_event_node == NULL) {
DBG3("UST app enable event %s not found for app PID %d."
- "Skipping app", uevent->attr.name, app->key.pid);
+ "Skipping app", uevent->attr.name, app->pid);
continue;
}
ua_event = caa_container_of(ua_event_node, struct ust_app_event, node);
rcu_read_lock();
/* For all registered applications */
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
break;
}
DBG2("UST app event %s already exist on app PID %d",
- uevent->attr.name, app->key.pid);
+ uevent->attr.name, app->pid);
continue;
}
}
struct ltt_ust_stream *ustream;
int consumerd_fd;
- DBG("Starting tracing for ust app pid %d", app->key.pid);
+ DBG("Starting tracing for ust app pid %d", app->pid);
rcu_read_lock();
goto error_rcu_unlock;
}
- ret = ustctl_create_stream(app->key.sock, ua_chan->obj,
+ ret = ustctl_create_stream(app->sock, ua_chan->obj,
&ustream->obj);
if (ret < 0) {
/* Got all streams */
skip_setup:
/* This start the UST tracing */
- ret = ustctl_start_session(app->key.sock, ua_sess->handle);
+ ret = ustctl_start_session(app->sock, ua_sess->handle);
if (ret < 0) {
- ERR("Error starting tracing for app pid: %d", app->key.pid);
+ ERR("Error starting tracing for app pid: %d", app->pid);
goto error_rcu_unlock;
}
/* Quiescent wait after starting trace */
- ustctl_wait_quiescent(app->key.sock);
+ ustctl_wait_quiescent(app->sock);
end:
rcu_read_unlock();
struct ust_app_session *ua_sess;
struct ust_app_channel *ua_chan;
- DBG("Stopping tracing for ust app pid %d", app->key.pid);
+ DBG("Stopping tracing for ust app pid %d", app->pid);
rcu_read_lock();
assert(ua_sess->started == 1);
/* This inhibits UST tracing */
- ret = ustctl_stop_session(app->key.sock, ua_sess->handle);
+ ret = ustctl_stop_session(app->sock, ua_sess->handle);
if (ret < 0) {
- ERR("Error stopping tracing for app pid: %d", app->key.pid);
+ ERR("Error stopping tracing for app pid: %d", app->pid);
goto error_rcu_unlock;
}
/* Quiescent wait after stopping trace */
- ustctl_wait_quiescent(app->key.sock);
+ ustctl_wait_quiescent(app->sock);
/* Flushing buffers */
cds_lfht_for_each_entry(ua_sess->channels->ht, &iter.iter, ua_chan,
node.node) {
- ret = ustctl_sock_flush_buffer(app->key.sock, ua_chan->obj);
+ ret = ustctl_sock_flush_buffer(app->sock, ua_chan->obj);
if (ret < 0) {
ERR("UST app PID %d channel %s flush failed with ret %d",
- app->key.pid, ua_chan->name, ret);
+ app->pid, ua_chan->name, ret);
/* Continuing flushing all buffers */
continue;
}
}
/* Flush all buffers before stopping */
- ret = ustctl_sock_flush_buffer(app->key.sock, ua_sess->metadata->obj);
+ ret = ustctl_sock_flush_buffer(app->sock, ua_sess->metadata->obj);
if (ret < 0) {
- ERR("UST app PID %d metadata flush failed with ret %d", app->key.pid,
+ ERR("UST app PID %d metadata flush failed with ret %d", app->pid,
ret);
}
struct lttng_ht_node_ulong *node;
int ret;
- DBG("Destroy tracing for ust app pid %d", app->key.pid);
+ DBG("Destroy tracing for ust app pid %d", app->pid);
rcu_read_lock();
obj.shm_fd = -1;
obj.wait_fd = -1;
obj.memory_map_size = 0;
- ustctl_release_object(app->key.sock, &obj);
+ ustctl_release_object(app->sock, &obj);
- delete_ust_app_session(app->key.sock, ua_sess);
+ delete_ust_app_session(app->sock, ua_sess);
/* Quiescent wait after stopping trace */
- ustctl_wait_quiescent(app->key.sock);
+ ustctl_wait_quiescent(app->sock);
end:
rcu_read_unlock();
rcu_read_lock();
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
ret = ust_app_start_trace(usess, app);
if (ret < 0) {
/* Continue to next apps even on error */
rcu_read_lock();
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
ret = ust_app_stop_trace(usess, app);
if (ret < 0) {
/* Continue to next apps even on error */
rcu_read_lock();
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
ret = ust_app_destroy_trace(usess, app);
if (ret < 0) {
/* Continue to next apps even on error */
goto error;
}
- DBG2("UST trace started for app pid %d", app->key.pid);
+ DBG2("UST trace started for app pid %d", app->pid);
}
error:
rcu_read_lock();
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
rcu_read_lock();
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
}
DBG2("UST app PID %d is compatible with major version %d "
- "(supporting <= %d)", app->key.pid, app->version.major,
+ "(supporting <= %d)", app->pid, app->version.major,
UST_APP_MAJOR_VERSION);
app->compatible = 1;
rcu_read_unlock();
error:
DBG2("UST app PID %d is not compatible with major version %d "
- "(supporting <= %d)", app->key.pid, app->version.major,
+ "(supporting <= %d)", app->pid, app->version.major,
UST_APP_MAJOR_VERSION);
app->compatible = 0;
rcu_read_unlock();
rcu_read_lock();
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) {
+ cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) {
if (!app->compatible) {
/*
* TODO: In time, we should notice the caller of this error by
continue;
}
- ret = ustctl_calibrate(app->key.sock, calibrate);
+ ret = ustctl_calibrate(app->sock, calibrate);
if (ret < 0) {
switch (ret) {
case -ENOSYS:
default:
/* TODO: Report error to user */
DBG2("Calibrate app PID %d returned with error %d",
- app->key.pid, ret);
+ app->pid, ret);
break;
}
}