#define BT_LOG_TAG "PLUGIN-UTILS-TRIMMER-FLT-COPY"
#include "logging.h"
-#include <assert.h>
+#include <babeltrace/assert-internal.h>
#include <babeltrace/babeltrace.h>
#include <ctfcopytrace.h>
{
enum bt_component_status ret;
struct bt_field *packet_context = NULL, *writer_packet_context = NULL;
- struct bt_field_type *struct_type = NULL, *field_type = NULL;
+ struct bt_field_class *struct_class = NULL, *field_class = NULL;
struct bt_field *field = NULL, *writer_field = NULL;
int nr_fields, i, int_ret;
BT_LOGD("Updating packet context field: name=%s", name);
packet_context = bt_packet_get_context(writer_packet);
- assert(packet_context);
+ BT_ASSERT(packet_context);
- struct_type = bt_field_get_type(packet_context);
- assert(struct_type);
+ struct_class = bt_field_get_class(packet_context);
+ BT_ASSERT(struct_class);
writer_packet_context = bt_packet_get_context(writer_packet);
- assert(writer_packet_context);
+ BT_ASSERT(writer_packet_context);
- nr_fields = bt_field_type_structure_get_field_count(struct_type);
+ nr_fields = bt_field_class_structure_get_field_count(struct_class);
for (i = 0; i < nr_fields; i++) {
const char *field_name;
name);
goto error;
}
- if (bt_field_type_structure_get_field_by_index(struct_type,
- &field_name, &field_type, i) < 0) {
+ if (bt_field_class_structure_get_field_by_index(struct_class,
+ &field_name, &field_class, i) < 0) {
BT_LOGE("Failed to get field: field-name=\"%s\"",
field_name);
goto error;
}
if (strcmp(field_name, name)) {
- BT_PUT(field_type);
+ BT_PUT(field_class);
BT_PUT(field);
continue;
}
- if (bt_field_type_get_type_id(field_type) !=
- BT_FIELD_TYPE_ID_INTEGER) {
+ if (bt_field_class_id(field_class) !=
+ BT_FIELD_CLASS_ID_INTEGER) {
BT_LOGE("Expecting an integer for this field: field-name=\"%s\"",
name);
goto error;
writer_field = bt_field_structure_get_field_by_name(writer_packet_context,
field_name);
- assert(writer_field);
+ BT_ASSERT(writer_field);
int_ret = bt_field_unsigned_integer_set_value(writer_field, value);
- assert(int_ret == 0);
+ BT_ASSERT(int_ret == 0);
BT_PUT(writer_field);
- BT_PUT(field_type);
+ BT_PUT(field_class);
BT_PUT(field);
}
error:
bt_put(writer_field);
- bt_put(field_type);
+ bt_put(field_class);
bt_put(field);
ret = BT_COMPONENT_STATUS_ERROR;
end:
- bt_put(struct_type);
+ bt_put(struct_class);
bt_put(packet_context);
return ret;
}
int int_ret;
stream = bt_packet_get_stream(packet);
- assert(stream);
+ BT_ASSERT(stream);
/*
* If a packet was already opened, close it and remove it from
int int_ret;
event_class = bt_event_get_class(event);
- assert(event_class);
+ BT_ASSERT(event_class);
event_name = bt_event_class_get_name(event_class);
}
packet = bt_event_get_packet(event);
- assert(packet);
+ BT_ASSERT(packet);
writer_packet = lookup_packet(trim_it, packet);
if (!writer_packet) {