g_ptr_array_set_size(event->stream->events_by_id, event->id + 1);
g_ptr_array_index(event->stream->events_by_id, event->id) = event;
g_hash_table_insert(event->stream->event_quark_to_id,
g_ptr_array_set_size(event->stream->events_by_id, event->id + 1);
g_ptr_array_index(event->stream->events_by_id, event->id) = event;
g_hash_table_insert(event->stream->event_quark_to_id,
if (CTF_STREAM_FIELD_IS_SET(stream, stream_id)) {
/* check that packet header has stream_id field. */
if (!trace->packet_header_decl
if (CTF_STREAM_FIELD_IS_SET(stream, stream_id)) {
/* check that packet header has stream_id field. */
if (!trace->packet_header_decl
ret = -EPERM;
fprintf(fd, "[error] %s: missing stream_id field in packet header declaration, but stream_id attribute is declared for stream.\n", __func__);
goto error;
ret = -EPERM;
fprintf(fd, "[error] %s: missing stream_id field in packet header declaration, but stream_id attribute is declared for stream.\n", __func__);
goto error;
if (!CTF_TRACE_FIELD_IS_SET(trace, byte_order)) {
/* check that the packet header contains a "magic" field */
if (!trace->packet_header_decl
if (!CTF_TRACE_FIELD_IS_SET(trace, byte_order)) {
/* check that the packet header contains a "magic" field */
if (!trace->packet_header_decl
ret = -EPERM;
fprintf(fd, "[error] %s: missing both byte_order and packet header magic number in trace declaration\n", __func__);
goto error;
ret = -EPERM;
fprintf(fd, "[error] %s: missing both byte_order and packet header magic number in trace declaration\n", __func__);
goto error;
if (!cs_dups) {
cs_dups = g_new0(struct ctf_callsite_dups, 1);
BT_INIT_LIST_HEAD(&cs_dups->head);
g_hash_table_insert(trace->callsites,
if (!cs_dups) {
cs_dups = g_new0(struct ctf_callsite_dups, 1);
BT_INIT_LIST_HEAD(&cs_dups->head);
g_hash_table_insert(trace->callsites,