From 32e87cebe6d26aefcff30cf542fb11f33a3ed7ea Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 19 May 2017 20:32:16 -0400 Subject: [PATCH] Logging: fix wrong parameters, superfluous commas, etc. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- cli/babeltrace.c | 2 +- lib/ctf-ir/attributes.c | 2 +- lib/ctf-ir/event-class.c | 4 ++-- lib/ctf-ir/field-types.c | 19 ++++++++++--------- lib/ctf-ir/fields.c | 2 +- lib/values.c | 10 +++++----- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/cli/babeltrace.c b/cli/babeltrace.c index 124ee53a..1af0e21b 100644 --- a/cli/babeltrace.c +++ b/cli/babeltrace.c @@ -1564,7 +1564,7 @@ int cmd_run_ctx_create_components_from_config_components( cfg_comp->instance_name->str, cfg_comp->params); if (!comp) { BT_LOGE("Cannot create component: plugin-name=\"%s\", " - "comp-cls-name=\"%s\", comp-cls-type=%d", + "comp-cls-name=\"%s\", comp-cls-type=%d, " "comp-name=\"%s\"", cfg_comp->plugin_name->str, cfg_comp->comp_cls_name->str, diff --git a/lib/ctf-ir/attributes.c b/lib/ctf-ir/attributes.c index f0029a04..f7e03a86 100644 --- a/lib/ctf-ir/attributes.c +++ b/lib/ctf-ir/attributes.c @@ -186,7 +186,7 @@ struct bt_value *bt_ctf_attributes_get_field_by_name( if (!attr_field_name_obj) { BT_LOGE("Cannot get attribute array value's element by index: " "value-addr=%p, index=%" PRIu64, - value_obj, 0); + value_obj, (int64_t) 0); goto error; } diff --git a/lib/ctf-ir/event-class.c b/lib/ctf-ir/event-class.c index 4e71ab55..f1859d34 100644 --- a/lib/ctf-ir/event-class.c +++ b/lib/ctf-ir/event-class.c @@ -420,7 +420,7 @@ bt_ctf_event_class_get_attribute_value_by_name( struct bt_value *ret; if (!event_class || !name) { - BT_LOGW("Invalid parameter: event class or name is NULL: ", + BT_LOGW("Invalid parameter: event class or name is NULL: " "event-class-addr=%p, name-addr=%p", event_class, name); ret = NULL; @@ -621,7 +621,7 @@ bt_ctf_event_class_get_payload_type_field_type_by_name( struct bt_ctf_field_type *field_type = NULL; if (!event_class || !name) { - BT_LOGW("Invalid parameter: event class or name is NULL: ", + BT_LOGW("Invalid parameter: event class or name is NULL: " "event-class-addr=%p, name-addr=%p", event_class, name); goto end; diff --git a/lib/ctf-ir/field-types.c b/lib/ctf-ir/field-types.c index 0cf5d1ef..4a4d789c 100644 --- a/lib/ctf-ir/field-types.c +++ b/lib/ctf-ir/field-types.c @@ -1009,14 +1009,14 @@ int bt_ctf_field_type_integer_set_size(struct bt_ctf_field_type *type, if (size == 0 || size > 64) { BT_LOGW("Invalid parameter: size must be between 1 and 64: " - "addr=%p, size=%u", type, size); + "addr=%p, size=%zu", type, size); ret = -1; goto end; } integer = container_of(type, struct bt_ctf_field_type_integer, parent); integer->size = size; - BT_LOGV("Set integer field type's size: addr=%p, size=%u", + BT_LOGV("Set integer field type's size: addr=%p, size=%zu", type, size); end: return ret; @@ -4792,8 +4792,8 @@ int bt_ctf_field_type_integer_compare(struct bt_ctf_field_type *type_a, if (int_type_a->mapped_clock != int_type_b->mapped_clock) { BT_LOGV("Integer field types differ: different mapped clock classes: " "ft-a-mapped-clock-class-addr=%p, " - "ft-b-mapped-clock-class-addr=%p, ", - "ft-a-mapped-clock-class-name=\"%s\", ", + "ft-b-mapped-clock-class-addr=%p, " + "ft-a-mapped-clock-class-name=\"%s\", " "ft-b-mapped-clock-class-name=\"%s\"", int_type_a->mapped_clock, int_type_b->mapped_clock, int_type_a->mapped_clock ? bt_ctf_clock_class_get_name(int_type_a->mapped_clock) : "", @@ -4833,7 +4833,7 @@ int bt_ctf_field_type_floating_point_compare(struct bt_ctf_field_type *type_a, /* Exponent length */ if (float_a->exp_dig != float_b->exp_dig) { BT_LOGV("Floating point number field types differ: different exponent sizes: " - "ft-a-exp-size=%s, ft-b-exp-size=%s", + "ft-a-exp-size=%u, ft-b-exp-size=%u", float_a->exp_dig, float_b->exp_dig); goto end; } @@ -4841,7 +4841,7 @@ int bt_ctf_field_type_floating_point_compare(struct bt_ctf_field_type *type_a, /* Mantissa length */ if (float_a->mant_dig != float_b->mant_dig) { BT_LOGV("Floating point number field types differ: different mantissa sizes: " - "ft-a-mant-size=%s, ft-b-mant-size=%s", + "ft-a-mant-size=%u, ft-b-mant-size=%u", float_a->mant_dig, float_b->mant_dig); goto end; } @@ -4999,7 +4999,7 @@ int compare_structure_fields(struct structure_field *field_a, ret = bt_ctf_field_type_compare(field_a->type, field_b->type); if (ret == 1) { BT_LOGV("Structure/variant field type fields differ: different field types: " - "field-name=\"%s\", field-a-ft-addr=%s, field-b-ft-addr=%s", + "field-name=\"%s\", field-a-ft-addr=%p, field-b-ft-addr=%p", g_quark_to_string(field_a->name), field_a->type, field_b->type); } @@ -5078,7 +5078,7 @@ int bt_ctf_field_type_variant_compare(struct bt_ctf_field_type *type_a, /* Tag name */ if (strcmp(variant_a->tag_name->str, variant_b->tag_name->str)) { BT_LOGV("Variant field types differ: different tag field names: " - "ft-a-tag-field-name=%u, ft-b-tag-field-name=%u", + "ft-a-tag-field-name=\"%s\", ft-b-tag-field-name=\"%s\"", variant_a->tag_name->str, variant_b->tag_name->str); goto end; } @@ -5176,7 +5176,8 @@ int bt_ctf_field_type_sequence_compare(struct bt_ctf_field_type *type_a, if (strcmp(sequence_a->length_field_name->str, sequence_b->length_field_name->str)) { BT_LOGV("Sequence field types differ: different length field names: " - "ft-a-length-field-name=%u, ft-b-length-field-name=%u", + "ft-a-length-field-name=\"%s\", " + "ft-b-length-field-name=\"%s\"", sequence_a->length_field_name->str, sequence_b->length_field_name->str); goto end; diff --git a/lib/ctf-ir/fields.c b/lib/ctf-ir/fields.c index 6caf2e45..d95fe335 100644 --- a/lib/ctf-ir/fields.c +++ b/lib/ctf-ir/fields.c @@ -2831,7 +2831,7 @@ int bt_ctf_field_structure_copy(struct bt_ctf_field *src, struct bt_ctf_field *field_copy = NULL; if (field) { - BT_LOGD("Copying structure field's field: src-field-addr=%p", + BT_LOGD("Copying structure field's field: src-field-addr=%p" "index=%" PRId64, field, i); field_copy = bt_ctf_field_copy(field); if (!field_copy) { diff --git a/lib/values.c b/lib/values.c index bf4bc2d6..65f53ebc 100644 --- a/lib/values.c +++ b/lib/values.c @@ -394,7 +394,7 @@ bt_bool bt_value_array_compare(const struct bt_value *object_a, if (!bt_value_compare(element_obj_a, element_obj_b)) { BT_LOGV("Array values's elements are different: " "value-a-addr=%p, value-b-addr=%p, index=%d", - element_obj_a, element_obj_b, index); + element_obj_a, element_obj_b, i); BT_PUT(element_obj_a); BT_PUT(element_obj_b); ret = BT_FALSE; @@ -670,7 +670,7 @@ struct bt_value *bt_value_string_create_init(const char *val) goto end; } - BT_LOGD("Creating string value object: val-len=%u", strlen(val)); + BT_LOGD("Creating string value object: val-len=%lu", strlen(val)); string_obj = g_new0(struct bt_value_string, 1); if (!string_obj) { @@ -776,7 +776,7 @@ enum bt_value_status bt_value_bool_get(const struct bt_value *bool_obj, if (!bt_value_is_bool(bool_obj)) { BT_LOGW("Invalid parameter: value is not a boolean value: addr=%p, " - "type=%s", bool_obj, bool_obj->type, + "type=%s", bool_obj, bt_value_type_string(bool_obj->type)); ret = BT_VALUE_STATUS_INVAL; goto end; @@ -1577,13 +1577,13 @@ struct bt_value *bt_value_map_extend(struct bt_value *base_map_obj, if (bt_value_map_foreach(extension_obj, extend_map_element, &extend_data)) { - BT_LOGE("Cannot iterate on the extension object's elements: ", + BT_LOGE("Cannot iterate on the extension object's elements: " "extension-value-addr=%p", extension_obj); goto error; } if (extend_data.got_error) { - BT_LOGE("Failed to successfully iterate on the extension object's elements: ", + BT_LOGE("Failed to successfully iterate on the extension object's elements: " "extension-value-addr=%p", extension_obj); goto error; } -- 2.34.1