-#ifndef _LTTNG_UST_COMM_H
-#define _LTTNG_UST_COMM_H
-
/*
- * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
- * Julien Desfossez <julien.desfossez@polymtl.ca>
- * 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.
+ * SPDX-License-Identifier: LGPL-2.1-only
*
- * 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
+ * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
/*
* These declarations should NOT be considered stable API.
*/
+#ifndef _LTTNG_UST_COMM_H
+#define _LTTNG_UST_COMM_H
+
#include <stdint.h>
#include <limits.h>
#include <unistd.h>
#include <lttng/ust-error.h>
#include <lttng/ust-compiler.h>
#include <lttng/ust-ctl.h>
+#include "helper.h"
#ifndef LTTNG_PACKED
#error "LTTNG_PACKED should be defined"
/* Length of struct lttng_ust_event_notifier */
uint32_t len;
} event_notifier;
+ /*
+ * For LTTNG_UST_COUNTER_EVENT, a struct
+ * lttng_ust_counter_event implicitly follows struct
+ * ustcomm_ust_msg.
+ */
+ struct {
+ /* Length of struct lttng_ust_counter_event */
+ uint32_t len;
+ } counter_event;
char padding[USTCOMM_MSG_PADDING2];
} u;
} LTTNG_PACKED;
uint32_t notify_cmd;
} LTTNG_PACKED;
-#define USTCOMM_NOTIFY_EVENT_MSG_PADDING 32
+#define USTCOMM_NOTIFY_EVENT_MSG_PADDING 24
struct ustcomm_notify_event_msg {
uint32_t session_objd;
uint32_t channel_objd;
uint32_t signature_len;
uint32_t fields_len;
uint32_t model_emf_uri_len;
+ uint64_t user_token;
char padding[USTCOMM_NOTIFY_EVENT_MSG_PADDING];
- /* followed by signature, fields, and model_emf_uri */
+ /* followed by signature, fields, model_emf_uri, and key */
} LTTNG_PACKED;
-#define USTCOMM_NOTIFY_EVENT_REPLY_PADDING 32
+#define USTCOMM_NOTIFY_EVENT_REPLY_PADDING 24
struct ustcomm_notify_event_reply {
int32_t ret_code; /* 0: ok, negative: error code */
- uint32_t event_id;
+ uint32_t event_id; /* for ring buffer channel events. */
+ uint64_t counter_index; /* for counter events. */
char padding[USTCOMM_NOTIFY_EVENT_REPLY_PADDING];
} LTTNG_PACKED;
/* followed by enum entries */
} LTTNG_PACKED;
-#define USTCOMM_NOTIFY_EVENT_REPLY_PADDING 32
+#define USTCOMM_NOTIFY_ENUM_REPLY_PADDING 32
struct ustcomm_notify_enum_reply {
int32_t ret_code; /* 0: ok, negative: error code */
uint64_t enum_id;
- char padding[USTCOMM_NOTIFY_EVENT_REPLY_PADDING];
+ char padding[USTCOMM_NOTIFY_ENUM_REPLY_PADDING];
} LTTNG_PACKED;
#define USTCOMM_NOTIFY_CHANNEL_MSG_PADDING 32
int ustcomm_recv_stream_from_sessiond(int sock,
uint64_t *memory_map_size,
int *shm_fd, int *wakeup_fd);
+LTTNG_HIDDEN
ssize_t ustcomm_recv_event_notifier_notif_fd_from_sessiond(int sock,
int *event_notifier_notif_fd);
+LTTNG_HIDDEN
ssize_t ustcomm_recv_counter_from_sessiond(int sock,
void **counter_data, uint64_t len);
+LTTNG_HIDDEN
int ustcomm_recv_counter_shm_from_sessiond(int sock,
int *shm_fd);
size_t nr_fields, /* fields */
const struct lttng_event_field *fields,
const char *model_emf_uri,
- uint32_t *id); /* event id (output) */
+ uint64_t user_token,
+ uint32_t *event_id, /* event id (output) */
+ uint64_t *counter_index); /* counter index (output) */
/*
* Returns 0 on success, negative error value on error.