Copyright ownership transfer
[lttng-tools.git] / src / bin / lttng-sessiond / event.c
index e687caf8622729a85a316ac367cf5172fce386d0..482ad602e4b349640050a397bb78649760b95380 100644 (file)
@@ -1,19 +1,9 @@
 /*
- * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
- * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2011 EfficiOS Inc.
+ * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * 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;
 }
 
 /*
This page took 0.02441 seconds and 4 git commands to generate.