#include <sys/shm.h>
#include <sys/ipc.h>
#include <ust/lttng-events.h>
-#include "usterr_signal_safe.h"
+#include <ust/usterr-signal-safe.h>
#include "ust/core.h"
#include "ltt-tracer.h"
#include "ust/wait.h"
{
struct ltt_session *session;
- pthread_mutex_lock(&sessions_mutex);
session = zmalloc(sizeof(struct ltt_session));
if (!session)
return NULL;
+ pthread_mutex_lock(&sessions_mutex);
CDS_INIT_LIST_HEAD(&session->chan);
CDS_INIT_LIST_HEAD(&session->events);
uuid_generate(session->uuid);
* headers. Therefore the "chan" information used as input
* should be already accessible.
*/
- chan->handle = transport->ops.channel_create("[lttng]", chan, buf_addr,
+ transport->ops.channel_create("[lttng]", chan, buf_addr,
subbuf_size, num_subbuf, switch_timer_interval,
read_timer_interval);
- chan->chan = shmp(chan->handle->header->chan);
if (!chan->chan)
goto create_error;
chan->enabled = 1;
static
void _ltt_channel_destroy(struct ltt_channel *chan)
{
- chan->ops->channel_destroy(chan->handle);
+ chan->ops->channel_destroy(chan);
cds_list_del(&chan->list);
lttng_destroy_context(chan->ctx);
free(chan);
for (pos = 0; pos < len; pos += reserve_len) {
reserve_len = min_t(size_t,
- chan->ops->packet_avail_size(chan->chan),
+ chan->ops->packet_avail_size(chan->chan, chan->handle),
len - pos);
lib_ring_buffer_ctx_init(&ctx, chan->chan, NULL, reserve_len,
- sizeof(char), -1);
+ sizeof(char), -1, chan->handle);
/*
* We don't care about metadata buffer's records lost
* count, because we always retry here. Report error if
ret != -ENOBUFS || !ret;
}),
LTTNG_METADATA_TIMEOUT_MSEC);
- if (!waitret || waitret == -EINTR || ret) {
+ if (waitret == -ETIMEDOUT || waitret == -EINTR || ret) {
DBG("LTTng: Failure to write metadata to buffers (%s)\n",
waitret == -EINTR ? "interrupted" :
(ret == -ENOBUFS ? "timeout" : "I/O error"));
" } extended;\n"
" } v;\n"
"} align(%u);\n\n",
- ltt_alignof(uint32_t) * CHAR_BIT,
- ltt_alignof(uint16_t) * CHAR_BIT
+ lttng_alignof(uint32_t) * CHAR_BIT,
+ lttng_alignof(uint16_t) * CHAR_BIT
);
}
" uint32_t stream_id;\n"
" };\n"
"};\n\n",
- ltt_alignof(uint8_t) * CHAR_BIT,
- ltt_alignof(uint16_t) * CHAR_BIT,
- ltt_alignof(uint32_t) * CHAR_BIT,
- ltt_alignof(uint64_t) * CHAR_BIT,
+ lttng_alignof(uint8_t) * CHAR_BIT,
+ lttng_alignof(uint16_t) * CHAR_BIT,
+ lttng_alignof(uint32_t) * CHAR_BIT,
+ lttng_alignof(uint64_t) * CHAR_BIT,
CTF_VERSION_MAJOR,
CTF_VERSION_MINOR,
uuid_s,
pthread_mutex_unlock(&sessions_mutex);
}
-static
-void __attribute__((destructor)) ltt_events_exit(void)
+void ltt_events_exit(void)
{
struct ltt_session *session, *tmpsession;