struct ustcomm_ust_msg lum;
struct ustcomm_ust_reply lur;
struct lttng_ust_object_data *event_notifier_data;
+ ssize_t len;
int ret;
if (!event_notifier_group || !_event_notifier_data)
memset(&lum, 0, sizeof(lum));
lum.handle = event_notifier_group->handle;
lum.cmd = LTTNG_UST_EVENT_NOTIFIER_CREATE;
+ lum.u.event_notifier.len = sizeof(*event_notifier);
- strncpy(lum.u.event_notifier.event.name, event_notifier->event.name,
- LTTNG_UST_SYM_NAME_LEN);
- lum.u.event_notifier.event.instrumentation = event_notifier->event.instrumentation;
- lum.u.event_notifier.event.loglevel_type = event_notifier->event.loglevel_type;
- lum.u.event_notifier.event.loglevel = event_notifier->event.loglevel;
- lum.u.event_notifier.event.token = event_notifier->event.token;
- lum.u.event_notifier.error_counter_index = event_notifier->error_counter_index;
- ret = ustcomm_send_app_cmd(sock, &lum, &lur);
+ ret = ustcomm_send_app_msg(sock, &lum);
+ if (ret) {
+ free(event_notifier_data);
+ return ret;
+ }
+ /* Send struct lttng_ust_event_notifier */
+ len = ustcomm_send_unix_sock(sock, event_notifier, sizeof(*event_notifier));
+ if (len != sizeof(*event_notifier)) {
+ if (len < 0)
+ return len;
+ else
+ return -EIO;
+ }
+ ret = ustcomm_recv_app_reply(sock, &lur, lum.handle, lum.cmd);
if (ret) {
free(event_notifier_data);
return ret;
struct lttng_ust_object_data **_counter_data)
{
struct lttng_ust_object_data *counter_data;
- struct lttng_ust_counter_conf counter_conf;
+ struct lttng_ust_counter_conf counter_conf = {0};
size_t i;
int ret;
}
switch (counter->attr->bitness) {
case USTCTL_COUNTER_BITNESS_32:
- counter_conf.bitness = LTTNG_UST_COUNTER_BITNESS_32BITS;
+ counter_conf.bitness = LTTNG_UST_COUNTER_BITNESS_32;
break;
case USTCTL_COUNTER_BITNESS_64:
- counter_conf.bitness = LTTNG_UST_COUNTER_BITNESS_64BITS;
+ counter_conf.bitness = LTTNG_UST_COUNTER_BITNESS_64;
break;
default:
return -EINVAL;