always copy packet/content_size, they are overwritten by the lib when necessary
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 2 Jun 2017 13:42:20 +0000 (09:42 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 21:02:58 +0000 (17:02 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/fs-sink/write.c
plugins/libctfcopytrace/ctfcopytrace.c
plugins/libctfcopytrace/ctfcopytrace.h
plugins/lttng-utils/copy.c
plugins/utils/trimmer/copy.c

index cf8112fd521af54b4160c364004629507f7f817d..305638cbbd4dd0a68a361ead7fb866124f882b50 100644 (file)
@@ -587,7 +587,7 @@ enum bt_component_status writer_new_packet(
        BT_PUT(stream);
 
        writer_packet_context = ctf_copy_packet_context(writer_component->err,
-                       packet, writer_stream, 1);
+                       packet, writer_stream);
        if (!writer_packet_context) {
                fprintf(writer_component->err, "[error] %s in %s:%d\n",
                                __func__, __FILE__, __LINE__);
index d2c7818468d252046c1e3cd4cdfc36d9d9969d18..a56e8146a306940af406b420e8a3906f863a4ed2 100644 (file)
@@ -512,8 +512,7 @@ end:
 BT_HIDDEN
 struct bt_ctf_field *ctf_copy_packet_context(FILE *err,
                struct bt_ctf_packet *packet,
-               struct bt_ctf_stream *writer_stream,
-               int skip_content_size)
+               struct bt_ctf_stream *writer_stream)
 {
        enum bt_component_status ret;
        struct bt_ctf_field *packet_context = NULL, *writer_packet_context = NULL;
@@ -575,13 +574,6 @@ struct bt_ctf_field *ctf_copy_packet_context(FILE *err,
                                        __FILE__, __LINE__);
                        goto error;
                }
-               if (skip_content_size &&
-                               (!strncmp(field_name, "content_size", strlen("content_size")) ||
-                               !strncmp(field_name, "packet_size", strlen("packet_size")))) {
-                       BT_PUT(field_type);
-                       BT_PUT(field);
-                       continue;
-               }
 
                if (bt_ctf_field_type_get_type_id(field_type) != BT_CTF_FIELD_TYPE_ID_INTEGER) {
                        fprintf(err, "[error] Unexpected packet context field type\n");
index 417b2d5d956ec3b5e1e25030e1e2eec975b58679..2ca5b789e810d954aa5ab2a8af8e5fd95692ce3f 100644 (file)
@@ -105,8 +105,6 @@ enum bt_component_status ctf_copy_packet_context_field(FILE *err,
 /*
  * Copy all the field values of the packet context from the packet passed in
  * parameter and set it to the current packet in the writer stream.
- * The content_size and packet_size fields are not copied if skip_content_size
- * is not 0.
  *
  * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on
  * error.
@@ -114,8 +112,7 @@ enum bt_component_status ctf_copy_packet_context_field(FILE *err,
 BT_HIDDEN
 struct bt_ctf_field *ctf_copy_packet_context(FILE *err,
                struct bt_ctf_packet *packet,
-               struct bt_ctf_stream *writer_stream,
-               int skip_content_size);
+               struct bt_ctf_stream *writer_stream);
 
 /*
  * Create and return a copy of the event passed in parameter. The caller has to
index 972cb36902cdcf32d1c5af85fe170f44e22679d3..d06bd88874e453d0d7b1f533cc4be209efe21644 100644 (file)
@@ -1054,7 +1054,7 @@ struct bt_ctf_packet *debug_info_new_packet(
        }
 
        writer_packet_context = ctf_copy_packet_context(debug_it->err, packet,
-                       writer_stream, 0);
+                       writer_stream);
        if (!writer_packet_context) {
                fprintf(debug_it->err, "[error] %s in %s:%d\n",
                                __func__, __FILE__, __LINE__);
index a76f7c054e28d45fb55331e19e0fb57ebea8e8ce..9d0d814171e5b6054d0a31098a241e4c854a8cc9 100644 (file)
@@ -194,7 +194,7 @@ struct bt_ctf_packet *trimmer_new_packet(
        bt_get(writer_packet);
 
        writer_packet_context = ctf_copy_packet_context(trim_it->err, packet,
-                       stream, 0);
+                       stream);
        if (!writer_packet_context) {
                fprintf(trim_it->err, "[error] %s in %s:%d\n",
                                __func__, __FILE__, __LINE__);
This page took 0.028039 seconds and 4 git commands to generate.