{
size_t size = 0;
- size += lib_ring_buffer_align(offset, lttng_alignof(pid_t));
- size += sizeof(pid_t);
+ size += lib_ring_buffer_align(offset, lttng_alignof(unsigned long));
+ size += sizeof(unsigned long);
return size;
}
}
field->event_field.name = "pthread_id";
field->event_field.type.atype = atype_integer;
- field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
- field->event_field.type.u.basic.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT;
+ field->event_field.type.u.basic.integer.size = sizeof(unsigned long) * CHAR_BIT;
+ field->event_field.type.u.basic.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT;
field->event_field.type.u.basic.integer.signedness = lttng_is_signed_type(pid_t);
field->event_field.type.u.basic.integer.reverse_byte_order = 0;
field->event_field.type.u.basic.integer.base = 10;
static struct object_data channel_data;
static struct object_data stream_data[MAX_NR_STREAMS];
static int event_handle[MAX_NR_EVENTS];
+static int context_handle;
static int apps_socket = -1;
static char apps_sock_path[PATH_MAX];
printf("received event handle %u\n", event_handle[k]);
}
+ /* Attach pthread_id context */
+ memset(&lum, 0, sizeof(lum));
+ lum.handle = channel_data.handle;
+ lum.cmd = LTTNG_UST_CONTEXT;
+ lum.u.context.ctx = LTTNG_UST_CONTEXT_PTHREAD_ID;
+ ret = send_app_cmd(sock, &lum, &lur);
+ if (ret)
+ return ret;
+ context_handle = lur.ret_val;
+ printf("received context handle %u\n", context_handle);
+
/* Get references to channel streams */
ret = open_streams(sock, channel_data.handle,
stream_data, MAX_NR_STREAMS);
if (ret)
return ret;
+ /* Release context */
+ memset(&lum, 0, sizeof(lum));
+ lum.handle = context_handle;
+ lum.cmd = LTTNG_UST_RELEASE;
+ ret = send_app_cmd(sock, &lum, &lur);
+ if (ret)
+ return ret;
+
/* Release events */
for (k = 0; k < nr_events; k++) {
memset(&lum, 0, sizeof(lum));