/*
- * 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
#include <lttng/ust-events.h>
#include <usterr-signal-safe.h>
-#include <helper.h>
+#include <ust-helper.h>
#include <lttng/ust-ctl.h>
#include <ust-comm.h>
#include <ust-fd.h>
-#include <lttng/ust-dynamic-type.h>
-#include <lttng/ust-context-provider.h>
+#include <ust-dynamic-type.h>
+#include <ust-context-provider.h>
#include "error.h"
#include "compat.h"
#include "lttng-ust-uuid.h"
static CDS_LIST_HEAD(sessions);
static CDS_LIST_HEAD(event_notifier_groups);
-struct cds_list_head *_lttng_get_sessions(void)
+struct cds_list_head *lttng_get_sessions(void)
{
return &sessions;
}
unsigned int i;
/* Get handle on list of sessions. */
- sessionsp = _lttng_get_sessions();
+ sessionsp = lttng_get_sessions();
/*
* Iterate over all events in the probe provider descriptions and
static
void _lttng_enabler_attach_filter_bytecode(struct lttng_enabler *enabler,
- struct lttng_ust_bytecode_node *bytecode)
+ struct lttng_ust_bytecode_node **bytecode)
{
- bytecode->enabler = enabler;
- cds_list_add_tail(&bytecode->node, &enabler->filter_bytecode_head);
+ (*bytecode)->enabler = enabler;
+ cds_list_add_tail(&(*bytecode)->node, &enabler->filter_bytecode_head);
+ /* Take ownership of bytecode */
+ *bytecode = NULL;
}
int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
- struct lttng_ust_bytecode_node *bytecode)
+ struct lttng_ust_bytecode_node **bytecode)
{
_lttng_enabler_attach_filter_bytecode(
lttng_event_enabler_as_enabler(event_enabler), bytecode);
static
void _lttng_enabler_attach_exclusion(struct lttng_enabler *enabler,
- struct lttng_ust_excluder_node *excluder)
+ struct lttng_ust_excluder_node **excluder)
{
- excluder->enabler = enabler;
- cds_list_add_tail(&excluder->node, &enabler->excluder_head);
+ (*excluder)->enabler = enabler;
+ cds_list_add_tail(&(*excluder)->node, &enabler->excluder_head);
+ /* Take ownership of excluder */
+ *excluder = NULL;
}
int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *event_enabler,
- struct lttng_ust_excluder_node *excluder)
+ struct lttng_ust_excluder_node **excluder)
{
_lttng_enabler_attach_exclusion(
lttng_event_enabler_as_enabler(event_enabler), excluder);
int lttng_event_notifier_enabler_attach_filter_bytecode(
struct lttng_event_notifier_enabler *event_notifier_enabler,
- struct lttng_ust_bytecode_node *bytecode)
+ struct lttng_ust_bytecode_node **bytecode)
{
_lttng_enabler_attach_filter_bytecode(
lttng_event_notifier_enabler_as_enabler(event_notifier_enabler),
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);
int lttng_event_notifier_enabler_attach_exclusion(
struct lttng_event_notifier_enabler *event_notifier_enabler,
- struct lttng_ust_excluder_node *excluder)
+ struct lttng_ust_excluder_node **excluder)
{
_lttng_enabler_attach_exclusion(
lttng_event_notifier_enabler_as_enabler(event_notifier_enabler),