X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fust-comm.h;h=32996dc55290cc978c4fbdd160928c0279a57d30;hb=refs%2Fheads%2Fsow-2020-0002-rev2;hp=c59003687e64601c565d86f738d82e0962a3ba45;hpb=8406222c45d29b23064d688e33be84894a51baac;p=deliverable%2Flttng-ust.git diff --git a/include/ust-comm.h b/include/ust-comm.h index c5900368..32996dc5 100644 --- a/include/ust-comm.h +++ b/include/ust-comm.h @@ -1,24 +1,9 @@ -#ifndef _LTTNG_UST_COMM_H -#define _LTTNG_UST_COMM_H - /* - * Copyright (C) 2011 - David Goulet - * Julien Desfossez - * Mathieu Desnoyers - * - * 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 + * Copyright (C) 2011 Julien Desfossez + * Copyright (C) 2011 Mathieu Desnoyers */ /* @@ -26,6 +11,9 @@ * These declarations should NOT be considered stable API. */ +#ifndef _LTTNG_UST_COMM_H +#define _LTTNG_UST_COMM_H + #include #include #include @@ -33,6 +21,7 @@ #include #include #include +#include "helper.h" #ifndef LTTNG_PACKED #error "LTTNG_PACKED should be defined" @@ -119,6 +108,15 @@ struct ustcomm_ust_msg { /* 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; @@ -152,7 +150,7 @@ struct ustcomm_notify_hdr { 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; @@ -161,14 +159,16 @@ struct ustcomm_notify_event_msg { 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; @@ -181,11 +181,11 @@ struct ustcomm_notify_enum_msg { /* 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 @@ -236,11 +236,14 @@ ssize_t ustcomm_recv_channel_from_sessiond(int sock, 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); @@ -271,7 +274,9 @@ int ustcomm_register_event(int sock, 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.