* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <errno.h>
#include <inttypes.h>
}
free(tmp_event);
release_ret = ustctl_release_handle(app->sock, handle);
- if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) {
+ if (release_ret < 0 &&
+ release_ret != -LTTNG_UST_ERR_EXITING &&
+ release_ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
pthread_mutex_unlock(&app->sock_lock);
free(tmp_event);
ret = -ENOMEM;
release_ret = ustctl_release_handle(app->sock, handle);
- if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) {
+ if (release_ret < 0 &&
+ release_ret != -LTTNG_UST_ERR_EXITING &&
+ release_ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
pthread_mutex_unlock(&app->sock_lock);
}
ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
- if (ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) {
+ if (ret < 0 && ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, ret);
}
}
free(tmp_event);
release_ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
- if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) {
+ if (release_ret < 0 &&
+ release_ret != -LTTNG_UST_ERR_EXITING &&
+ release_ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
goto rcu_error;
ret = -ENOMEM;
release_ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
- if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) {
+ if (release_ret &&
+ release_ret != -LTTNG_UST_ERR_EXITING &&
+ release_ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret);
}
goto rcu_error;
}
ret = ustctl_release_handle(app->sock, handle);
pthread_mutex_unlock(&app->sock_lock);
- if (ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) {
+ if (ret < 0 &&
+ ret != -LTTNG_UST_ERR_EXITING &&
+ ret != -EPIPE) {
ERR("Error releasing app handle for app %d with ret %d", app->sock, ret);
}
}
{
int ret = 0;
struct lttng_ht_iter iter, uiter;
- struct lttng_ht_node_str *ua_chan_node, *ua_event_node;
+ struct lttng_ht_node_str *ua_chan_node;
struct ust_app *app;
struct ust_app_session *ua_sess;
struct ust_app_channel *ua_chan;
}
ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node);
- lttng_ht_lookup(ua_chan->events, (void *)uevent->attr.name, &uiter);
- ua_event_node = lttng_ht_iter_get_node_str(&uiter);
- if (ua_event_node == NULL) {
+ ua_event = find_ust_app_event(ua_chan->events, uevent->attr.name,
+ uevent->filter, uevent->attr.loglevel,
+ uevent->exclusion);
+ if (ua_event == NULL) {
DBG2("Event %s not found in channel %s for app pid %d."
"Skipping", uevent->attr.name, uchan->name, app->pid);
continue;
}
- ua_event = caa_container_of(ua_event_node, struct ust_app_event, node);
ret = disable_ust_app_event(ua_sess, ua_event, app);
if (ret < 0) {