static int event_counter_add(struct lttng_ust_event_counter *event_counter, int64_t v)
{
struct lttng_ust_channel_counter *counter = event_counter->chan;
- size_t index = event_counter->priv->counter_index;
+ size_t index = event_counter->priv->parent.id;
return counter_add(counter, &index, v);
}
static int event_counter_add(struct lttng_ust_event_counter *event_counter, int64_t v)
{
struct lttng_ust_channel_counter *counter = event_counter->chan;
- size_t index = event_counter->priv->counter_index;
+ size_t index = event_counter->priv->parent.id;
return counter_add(counter, &index, v);
}
struct lttng_ust_ctx *ctx;
struct lttng_ust_channel_common *chan;
+
+ uint64_t id; /* Event id */
};
struct lttng_ust_event_recorder_private {
struct lttng_ust_event_session_common_private parent;
struct lttng_ust_event_recorder *pub; /* Public event interface */
- unsigned int id;
};
struct lttng_ust_event_counter_private {
struct lttng_ust_event_counter *pub; /* Public event interface */
char key[LTTNG_KEY_TOKEN_STRING_LEN_MAX];
- uint64_t counter_index;
};
struct lttng_ust_event_notifier_private {
struct lttng_ust_ring_buffer_ctx_private *private_ctx;
uint32_t event_id;
- event_id = event_recorder->priv->id;
+ event_id = (uint32_t) event_recorder->priv->parent.id;
client_ctx.chan_ctx = lttng_ust_rcu_dereference(lttng_chan->priv->ctx);
client_ctx.event_ctx = lttng_ust_rcu_dereference(event_recorder->priv->parent.ctx);
/* Compute internal size of context structures. */
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 */
- ret = ustcomm_register_event(notify_socket,
+ return ustcomm_register_event(notify_socket,
session,
session->priv->objd,
event_recorder_enabler->chan->priv->parent.objd,
desc->tp_class->fields,
uri,
0,
- &id);
- if (ret)
- return ret;
- event_recorder_priv->id = id;
- return 0;
+ &event_recorder_priv->parent.id);
}
case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
desc->tp_class->fields,
uri,
event_counter_enabler->parent.parent.user_token,
- &event_counter_priv->counter_index);
+ &event_counter_priv->parent.id);
}
default:
return -EINVAL;