Fix incorrect error handling of ust_app_add_channel_all and
ust_app_add_event_all commands. Make ust_app_start_trace take RCU
read-side lock, because this API is exposed outside of ust-app.c.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
/* Add channel to all registered applications */
ret = ust_app_add_channel_all(usess, uchan);
/* Add channel to all registered applications */
ret = ust_app_add_channel_all(usess, uchan);
- if (ret != LTTCOMM_OK) {
/* Create session on the tracer side and add it to app session HT */
ua_sess = create_ust_app_session(usess, app);
/* Create session on the tracer side and add it to app session HT */
ua_sess = create_ust_app_session(usess, app);
/* Create session on the tracer side and add it to app session HT */
ua_sess = create_ust_app_session(usess, app);
/* Create session on the tracer side and add it to app session HT */
ua_sess = create_ust_app_session(usess, app);
DBG("Starting tracing for ust app pid %d", app->key.pid);
DBG("Starting tracing for ust app pid %d", app->key.pid);
ua_sess = lookup_session_by_app(usess, app);
if (ua_sess == NULL) {
/* Only malloc can failed so something is really wrong */
ua_sess = lookup_session_by_app(usess, app);
if (ua_sess == NULL) {
/* Only malloc can failed so something is really wrong */
}
ret = create_ust_app_metadata(ua_sess, usess->pathname, app);
if (ret < 0) {
}
ret = create_ust_app_metadata(ua_sess, usess->pathname, app);
if (ret < 0) {
ustream = zmalloc(sizeof(*ustream));
if (ustream == NULL) {
PERROR("zmalloc ust stream");
ustream = zmalloc(sizeof(*ustream));
if (ustream == NULL) {
PERROR("zmalloc ust stream");
}
ret = ustctl_create_stream(app->key.sock, ua_chan->obj,
}
ret = ustctl_create_stream(app->key.sock, ua_chan->obj,
/* Setup UST consumer socket and send fds to it */
ret = ust_consumer_send_session(usess->consumer_fd, ua_sess);
if (ret < 0) {
/* Setup UST consumer socket and send fds to it */
ret = ust_consumer_send_session(usess->consumer_fd, ua_sess);
if (ret < 0) {
}
/* This start the UST tracing */
ret = ustctl_start_session(app->key.sock, ua_sess->handle);
if (ret < 0) {
ERR("Error starting tracing for app pid: %d", app->key.pid);
}
/* This start the UST tracing */
ret = ustctl_start_session(app->key.sock, ua_sess->handle);
if (ret < 0) {
ERR("Error starting tracing for app pid: %d", app->key.pid);
/* Quiescent wait after starting trace */
ustctl_wait_quiescent(app->key.sock);
return 0;
/* Quiescent wait after starting trace */
ustctl_wait_quiescent(app->key.sock);
return 0;
+error_rcu_unlock:
+ rcu_read_unlock();