* Returns 0 on success, negative error value on error.
*/
int lttng_ust_ctl_reply_register_event(int sock,
- uint32_t event_id, /* event id (input) */
- uint64_t counter_index, /* counter index (input) */
+ uint64_t id, /* id (input) */
int ret_code); /* return code. 0 ok, negative error */
/*
const struct lttng_ust_event_field * const *lttng_fields,
const char *model_emf_uri,
uint64_t user_token,
- uint32_t *event_id, /* event id (output) */
- uint64_t *counter_index) /* counter index (output) */
+ uint64_t *id) /* event id (output) */
{
ssize_t len;
struct {
return -EINVAL;
if (reply.r.ret_code < 0)
return reply.r.ret_code;
- if (event_id)
- *event_id = reply.r.event_id;
- if (counter_index)
- *counter_index = reply.r.counter_index;
- DBG("Sent register event notification for name \"%s\": ret_code %d, event_id %u, counter_index %" PRIu64 "\n",
- event_name, reply.r.ret_code, reply.r.event_id, reply.r.counter_index);
+ *id = reply.r.id;
+ DBG("Sent register event notification for name \"%s\": ret_code %d, id %" PRIu64 "\n",
+ event_name, reply.r.ret_code, reply.r.id);
return 0;
default:
if (len < 0) {
#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; /* for ring buffer channel events */
- uint64_t counter_index; /* for counter channel events */
+
+ /* 32-bit (lower bits) event id for backward compatibility with ABI major < 10 */
+ uint32_t old_event_id; /* TODO: remove field on future protocol compatibility break. */
+ uint64_t id; /* 64-bit event id. */
char padding[USTCOMM_NOTIFY_EVENT_REPLY_PADDING];
} __attribute__((packed));
const struct lttng_ust_event_field * const *fields,
const char *model_emf_uri,
uint64_t user_token,
- uint32_t *id, /* event id (output) */
- uint64_t *counter_index) /* counter index (output) */
+ uint64_t *id) /* (output) */
__attribute__((visibility("hidden")));
/*
* Returns 0 on success, negative error value on error.
*/
int lttng_ust_ctl_reply_register_event(int sock,
- uint32_t event_id,
- uint64_t counter_index,
+ uint64_t id,
int ret_code)
{
ssize_t len;
memset(&reply, 0, sizeof(reply));
reply.header.notify_cmd = LTTNG_UST_CTL_NOTIFY_CMD_EVENT;
reply.r.ret_code = ret_code;
- reply.r.event_id = event_id;
- reply.r.counter_index = counter_index;
+ reply.r.old_event_id = (uint32_t) id; /* For backward compatibility */
+ reply.r.id = id;
len = ustcomm_send_unix_sock(sock, &reply, sizeof(reply));
if (len > 0 && len != sizeof(reply))
return -EIO;
struct lttng_ust_event_recorder_private *event_recorder_priv =
caa_container_of(event->priv, struct lttng_ust_event_recorder_private, parent.parent);
struct lttng_ust_session *session = event_recorder_enabler->chan->parent->session;
+ uint64_t id;
+ int ret;
notify_socket = lttng_get_notify_socket(session->priv->owner);
if (notify_socket < 0)
return notify_socket;
/* Fetch event ID from sessiond */
- return ustcomm_register_event(notify_socket,
+ ret = ustcomm_register_event(notify_socket,
session,
session->priv->objd,
event_recorder_enabler->chan->priv->parent.objd,
desc->tp_class->fields,
uri,
0,
- &event_recorder_priv->id,
- NULL);
+ &id);
+ if (ret)
+ return ret;
+ event_recorder_priv->id = id;
+ return 0;
}
case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
desc->tp_class->fields,
uri,
event_counter_enabler->parent.parent.user_token,
- NULL,
&event_counter_priv->counter_index);
}
default: