summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2d12d31)
I found some functions using BT_ASSERT_PRE_DEV_FC_NON_NULL followed by
either BT_ASSERT_PRE_FC_HAS_TYPE or BT_ASSERT_PRE_FC_IS_STRUCT (i.e. a
dev followed by a non-dev). This seems illogical to me. Either the
function is considered "fast path" and we use the dev versions, either
it's not "fast path" and we use the non-dev versions.
Change a few assertions to be dev. If some of these functions aren't
actually considered fast path, then I think we should switch the
BT_ASSERT_PRE_DEV_FC_NON_NULLs to be non-dev.
Change-Id: I4f0c1cb0ef1006beddcc688d4e71f37fdb561e15
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7326
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10807
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
struct bt_field_class_structure *struct_fc = (void *) fc;
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
struct bt_field_class_structure *struct_fc = (void *) fc;
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_IS_STRUCT("field-class", fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_IS_STRUCT("field-class", fc, "Field class");
return (uint64_t) struct_fc->common.named_fcs->len;
}
return (uint64_t) struct_fc->common.named_fcs->len;
}
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_IS_STRUCT("field-class", fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_IS_STRUCT("field-class", fc, "Field class");
return (const void *)
borrow_named_field_class_from_container_field_class_at_index(
(void *) fc, index, __func__);
return (const void *)
borrow_named_field_class_from_container_field_class_at_index(
(void *) fc, index, __func__);
struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_IS_STRUCT("field-class", fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_IS_STRUCT("field-class", fc, "Field class");
return (void *)
borrow_named_field_class_from_container_field_class_at_index(
(void *) fc, index, __func__);
return (void *)
borrow_named_field_class_from_container_field_class_at_index(
(void *) fc, index, __func__);
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_IS_STRUCT("field-class", fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_IS_STRUCT("field-class", fc, "Field class");
return (const void *)
borrow_named_field_class_from_container_field_class_by_name(
(void *) fc, name, __func__);
return (const void *)
borrow_named_field_class_from_container_field_class_by_name(
(void *) fc, name, __func__);
struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_IS_STRUCT("field-class", fc, "Field class");
+ BT_ASSERT_PRE_DEV_FC_IS_STRUCT("field-class", fc, "Field class");
return (void *)
borrow_named_field_class_from_container_field_class_by_name(
(void *) fc, name, __func__);
return (void *)
borrow_named_field_class_from_container_field_class_by_name(
(void *) fc, name, __func__);
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_HAS_TYPE("field-class", fc,
+ BT_ASSERT_PRE_DEV_FC_HAS_TYPE("field-class", fc,
"variant-field-class-with-unsigned-integer-selector-field",
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
"variant-field-class-with-unsigned-integer-selector-field",
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_HAS_TYPE("field-class", fc,
+ BT_ASSERT_PRE_DEV_FC_HAS_TYPE("field-class", fc,
"variant-field-class-with-unsigned-integer-selector-field",
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
"variant-field-class-with-unsigned-integer-selector-field",
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
const struct bt_field_class *fc, const char *name)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_HAS_TYPE("field-class", fc,
+ BT_ASSERT_PRE_DEV_FC_HAS_TYPE("field-class", fc,
"variant-field-class-with-signed-integer-selector-field",
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
"variant-field-class-with-signed-integer-selector-field",
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
const struct bt_field_class *fc, uint64_t index)
{
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_HAS_TYPE("field-class", fc,
+ BT_ASSERT_PRE_DEV_FC_HAS_TYPE("field-class", fc,
"variant-field-class-with-signed-integer-selector-field",
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
"variant-field-class-with-signed-integer-selector-field",
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
"Field class");
const struct bt_field_class_array_static *array_fc = (const void *) fc;
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
const struct bt_field_class_array_static *array_fc = (const void *) fc;
BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
- BT_ASSERT_PRE_FC_HAS_TYPE("field-class", fc,
+ BT_ASSERT_PRE_DEV_FC_HAS_TYPE("field-class", fc,
"static-array-field-class", BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
"Field class");
return (uint64_t) array_fc->length;
"static-array-field-class", BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
"Field class");
return (uint64_t) array_fc->length;