This reverts commit
bbc5046d02a09977fb1743ad26b7fcedeb888850.
After further discussion, we concluded that the existing behavior
(before the reverted patch) is desirable. It should only be forbidden
to call an API function while there is a current error for API functions
that can fail and set a current error themselves.
The documentation currently says:
You cannot call any libbabeltrace2 function when the current thread
has an error, except the reference counting functions (ending with
_get_ref() or _put_ref()).
It will later be updated to reflect the fact that it's allowed to call
API functions that can't fail while there is a current error.
Change-Id: Id7d1419862066e0e3d9fd537198b7e630a9c2dc8
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10034
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
BT_EXPORT
const char *bt_clock_class_get_name(const struct bt_clock_class *clock_class)
{
BT_EXPORT
const char *bt_clock_class_get_name(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->name.value;
}
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->name.value;
}
const char *bt_clock_class_get_description(
const struct bt_clock_class *clock_class)
{
const char *bt_clock_class_get_description(
const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->description.value;
}
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->description.value;
}
BT_EXPORT
uint64_t bt_clock_class_get_frequency(const struct bt_clock_class *clock_class)
{
BT_EXPORT
uint64_t bt_clock_class_get_frequency(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->frequency;
}
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->frequency;
}
void bt_clock_class_set_frequency(struct bt_clock_class *clock_class,
uint64_t frequency)
{
void bt_clock_class_set_frequency(struct bt_clock_class *clock_class,
uint64_t frequency)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE("valid-frequency",
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE("valid-frequency",
BT_EXPORT
uint64_t bt_clock_class_get_precision(const struct bt_clock_class *clock_class)
{
BT_EXPORT
uint64_t bt_clock_class_get_precision(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->precision;
}
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->precision;
}
void bt_clock_class_set_precision(struct bt_clock_class *clock_class,
uint64_t precision)
{
void bt_clock_class_set_precision(struct bt_clock_class *clock_class,
uint64_t precision)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE("valid-precision", precision != UINT64_C(-1),
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE("valid-precision", precision != UINT64_C(-1),
void bt_clock_class_get_offset(const struct bt_clock_class *clock_class,
int64_t *seconds, uint64_t *cycles)
{
void bt_clock_class_get_offset(const struct bt_clock_class *clock_class,
int64_t *seconds, uint64_t *cycles)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_NON_NULL("seconds-output", seconds,
"Seconds (output)");
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_NON_NULL("seconds-output", seconds,
"Seconds (output)");
void bt_clock_class_set_offset(struct bt_clock_class *clock_class,
int64_t seconds, uint64_t cycles)
{
void bt_clock_class_set_offset(struct bt_clock_class *clock_class,
int64_t seconds, uint64_t cycles)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE("offset-cycles-lt-frequency",
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE("offset-cycles-lt-frequency",
BT_EXPORT
bt_uuid bt_clock_class_get_uuid(const struct bt_clock_class *clock_class)
{
BT_EXPORT
bt_uuid bt_clock_class_get_uuid(const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->uuid.value;
}
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->uuid.value;
}
void bt_clock_class_set_uuid(struct bt_clock_class *clock_class,
bt_uuid uuid)
{
void bt_clock_class_set_uuid(struct bt_clock_class *clock_class,
bt_uuid uuid)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_UUID_NON_NULL(uuid);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_UUID_NON_NULL(uuid);
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
const struct bt_value *bt_clock_class_borrow_user_attributes_const(
const struct bt_clock_class *clock_class)
{
const struct bt_value *bt_clock_class_borrow_user_attributes_const(
const struct bt_clock_class *clock_class)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->user_attributes;
}
BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
return clock_class->user_attributes;
}
struct bt_clock_class *clock_class,
const struct bt_value *user_attributes)
{
struct bt_clock_class *clock_class,
const struct bt_value *user_attributes)
{
- BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);