X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fevent.c;h=ffeaa72f4aa473ea0c5851d00214ab28026e85ca;hb=0360bb60030c805145e41e1bb59baf162176dbac;hp=a8b7646da6f9401c617761e3f6ca349e274ed065;hpb=bf7886d8856443676d98326022583baddc81297e;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index a8b7646da..ffeaa72f4 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -1,19 +1,9 @@ /* - * Copyright (C) 2011 - David Goulet - * Copyright (C) 2016 - Jérémie Galarneau + * Copyright (C) 2011 David Goulet + * Copyright (C) 2016 Jérémie Galarneau * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2 only, - * as published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE @@ -31,7 +21,8 @@ #include "event.h" #include "kernel.h" #include "lttng-sessiond.h" -#include "ust-ctl.h" +#include "lttng-ust-ctl.h" +#include "lttng-ust-error.h" #include "ust-app.h" #include "trace-kernel.h" #include "trace-ust.h" @@ -182,7 +173,7 @@ int event_ust_enable_tracepoint(struct ltt_ust_session *usess, filter = NULL; exclusion = NULL; if (ret != LTTNG_OK) { - goto error; + goto end; } /* Valid to set it after the goto error since uevent is still NULL */ @@ -217,11 +208,10 @@ int event_ust_enable_tracepoint(struct ltt_ust_session *usess, if (ret < 0) { if (ret == -LTTNG_UST_ERR_EXIST) { ret = LTTNG_ERR_UST_EVENT_EXIST; - goto end; } else { ret = LTTNG_ERR_UST_ENABLE_FAIL; - goto error; } + goto end; } DBG("Event UST %s %s in channel %s", uevent->attr.name, @@ -235,24 +225,6 @@ end: free(filter); free(exclusion); return ret; - -error: - /* - * Only destroy event on creation time (not enabling time) because if the - * event is found in the channel (to_create == 0), it means that at some - * point the enable_event worked and it's thus valid to keep it alive. - * Destroying it also implies that we also destroy it's shadow copy to sync - * everyone up. - */ - if (to_create) { - /* In this code path, the uevent was not added to the hash table */ - trace_ust_destroy_event(uevent); - } - rcu_read_unlock(); - free(filter_expression); - free(filter); - free(exclusion); - return ret; } /* @@ -511,6 +483,7 @@ int event_agent_enable(struct ltt_ust_session *usess, filter = NULL; filter_expression = NULL; created = 1; + assert(!aevent->enabled); } if (created && aevent->filter) {