Change UUID API prefix from babeltrace_ to bt_
[babeltrace.git] / converter / babeltrace-log.c
index 5a8b26a8076ec4c26cdbdf3390403cf61b6f3e0f..b724ccd67ebd5aecbb26d671d2e858e2d978b533 100644 (file)
@@ -108,7 +108,7 @@ void print_metadata(FILE *fp)
        ret = sscanf(VERSION, "%u.%u", &major, &minor);
        if (ret != 2)
                fprintf(stderr, "[warning] Incorrect babeltrace version format\n.");
-       babeltrace_uuid_unparse(s_uuid, uuid_str);
+       bt_uuid_unparse(s_uuid, uuid_str);
        fprintf(fp, metadata_fmt,
                major,
                minor,
@@ -276,13 +276,15 @@ void trace_string(char *line, struct ctf_stream_pos *pos, size_t len)
        printf_debug("read: %s\n", line);
 
        for (;;) {
+               int packet_filled = 0;
+
                ctf_dummy_pos(pos, &dummy);
                write_event_header(&dummy, line, &tline, len, &tlen, &ts);
                if (!ctf_align_pos(&dummy, sizeof(uint8_t) * CHAR_BIT))
-                       goto error;
+                       packet_filled = 1;
                if (!ctf_move_pos(&dummy, tlen * CHAR_BIT))
-                       goto error;
-               if (ctf_pos_packet(&dummy)) {
+                       packet_filled = 1;
+               if (packet_filled || ctf_pos_packet(&dummy)) {
                        ctf_pos_pad_packet(pos);
                        write_packet_header(pos, s_uuid);
                        write_packet_context(pos);
@@ -325,6 +327,7 @@ void trace_text(FILE *input, int output)
                fprintf(stderr, "Error in ctf_init_pos\n");
                return;
        }
+       ctf_packet_seek(&pos.parent, 0, SEEK_CUR);
        write_packet_header(&pos, s_uuid);
        write_packet_context(&pos);
        for (;;) {
@@ -437,7 +440,7 @@ int main(int argc, char **argv)
                goto error_closemetadatafd;
        }
 
-       babeltrace_uuid_generate(s_uuid);
+       bt_uuid_generate(s_uuid);
        print_metadata(metadata_fp);
        trace_text(stdin, fd);
 
This page took 0.023755 seconds and 4 git commands to generate.