/*
- * lttng-events.c
- *
- * Holds LTTng per-session event registry.
+ * SPDX-License-Identifier: LGPL-2.1-only
*
* Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; only
- * version 2.1 of the License.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Holds LTTng per-session event registry.
*/
#define _LGPL_SOURCE
int lttng_event_notifier_enabler_attach_capture_bytecode(
struct lttng_event_notifier_enabler *event_notifier_enabler,
- struct lttng_ust_bytecode_node *bytecode)
+ struct lttng_ust_bytecode_node **bytecode)
{
- bytecode->enabler = lttng_event_notifier_enabler_as_enabler(
+ (*bytecode)->enabler = lttng_event_notifier_enabler_as_enabler(
event_notifier_enabler);
- cds_list_add_tail(&bytecode->node,
+ cds_list_add_tail(&(*bytecode)->node,
&event_notifier_enabler->capture_bytecode_head);
+ /* Take ownership of bytecode */
+ *bytecode = NULL;
event_notifier_enabler->num_captures++;
lttng_event_notifier_group_sync_enablers(event_notifier_enabler->group);