lib: make BT_ASSERT_{PRE,POST}() always on; add BT_ASSERT_{PRE,POST}_DEV()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 9 Jul 2019 12:25:44 +0000 (08:25 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 9 Jul 2019 23:42:30 +0000 (19:42 -0400)
This patch makes the BT_ASSERT_PRE() and BT_ASSERT_POST() macros, and
all their variants, always executed. In other words, the checks are
executed in developer mode and in production mode.

What used to be BT_ASSERT_PRE() and BT_ASSERT_POST(), enabled only in
developer mode, is now BT_ASSERT_PRE_DEV() and BT_ASSERT_POST_DEV().

The goal of this patch is to add precondition and postcondition checks
on the slow path which are enabled in production to catch more
programming errors. As I meticulously chose which one to invoke at each
site, this patch does not change the performance of the library during a
graph run, which is most of the execution time.

Because all the freezing functions are only enabled in developer mode,
`assert-pre.h` only offers BT_ASSERT_PRE_DEV_HOT() currently (there's no
production mode BT_ASSERT_PRE_HOT()). This is because some freezing
functions can be called on the fast path (for example, the internal
bt_event_create() freezes the event class, packet, and stream; this is
called for each event message), while other are only called on the slow
path. This patch does not decouple the frequent ones from the infrequent
ones; this work should be done by a subsequent patch.

Where all the precondition/postcondition assertions used to be only
enabled in developer mode, the library now contains 105 production
checks.

When I test with a 1.4 GiB CTF trace and a dummy output in production
mode, the difference of the total execution times with and without this
patch falls within the range of uncertainty.

The guideline to use one or the other is:

* Use BT_ASSERT_PRE_DEV() and BT_ASSERT_POST_DEV() when the call site
  could occur at least once per message.

  This is why all the borrowing functions use the developer mode
  versions as we don't know at which frequency what will be accessed.

* Use BT_ASSERT_PRE() and BT_ASSERT_POST() everywhere else.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I2ccdec4cee332a13d330474d287c564b7cb90352
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1661
Tested-by: jenkins <jenkins@lttng.org>
40 files changed:
CONTRIBUTING.adoc
src/lib/assert-post.h
src/lib/assert-pre.h
src/lib/graph/component-class.c
src/lib/graph/component-filter.c
src/lib/graph/component-sink.c
src/lib/graph/component-source.c
src/lib/graph/component.c
src/lib/graph/connection.c
src/lib/graph/graph.c
src/lib/graph/graph.h
src/lib/graph/iterator.c
src/lib/graph/message/discarded-items.c
src/lib/graph/message/event.c
src/lib/graph/message/message-iterator-inactivity.c
src/lib/graph/message/message.c
src/lib/graph/message/message.h
src/lib/graph/message/packet.c
src/lib/graph/message/stream.c
src/lib/graph/port.c
src/lib/graph/query-executor.c
src/lib/object.h
src/lib/plugin/plugin.c
src/lib/trace-ir/clock-class.c
src/lib/trace-ir/clock-snapshot.c
src/lib/trace-ir/event-class.c
src/lib/trace-ir/event.c
src/lib/trace-ir/event.h
src/lib/trace-ir/field-class.c
src/lib/trace-ir/field-class.h
src/lib/trace-ir/field-path.c
src/lib/trace-ir/field.c
src/lib/trace-ir/field.h
src/lib/trace-ir/packet.c
src/lib/trace-ir/resolve-field-path.c
src/lib/trace-ir/stream-class.c
src/lib/trace-ir/stream.c
src/lib/trace-ir/trace-class.c
src/lib/trace-ir/trace.c
src/lib/value.c

index 066382a480d2f8addc5160eb68a76d016770bb3a..c5fb796862a5b799181c3402cff889cfb2bc52d3 100644 (file)
@@ -1268,8 +1268,10 @@ A _FATAL_-level logging statement should always be followed by
 * Logic error in internal code, for example an unexpected value in a
   `switch` statement.
 * Failed assertion (within `BT_ASSERT()`).
-* Unsatisfied library precondition (within `BT_ASSERT_PRE()`).
-* Unsatisfied library postcondition (within `BT_ASSERT_POST()`).
+* Unsatisfied library precondition (within `BT_ASSERT_PRE()` or
+  `BT_ASSERT_PRE_DEV()`).
+* Unsatisfied library postcondition (within `BT_ASSERT_POST()` or
+  `BT_ASSERT_POST_DEV()`).
 |Almost none: always enabled.
 
 |_ERROR_
index 9776bde09af6bb5e722ac8db420638ea8b98d23c..2ed45a51f50151a872a548c8356ca9aa50ca2f1b 100644 (file)
 #include <inttypes.h>
 #include "common/macros.h"
 
-#ifdef BT_DEV_MODE
 /*
  * Prints the details of an unsatisfied postcondition without
  * immediately aborting. You should use this within a function which
- * checks postconditions, but which is called from a BT_ASSERT_POST()
- * context, so that the function can still return its result for
- * BT_ASSERT_POST() to evaluate it.
+ * checks postconditions, but which is called from a
+ * BT_ASSERT_POST() context, so that the function can still return
+ * its result for BT_ASSERT_POST() to evaluate it.
  *
  * Example:
  *
@@ -69,9 +68,9 @@
  *     ...
  *
  *     BT_ASSERT_POST(check_complex_postcond(...),
- *                   "Postcondition is not satisfied: ...", ...);
+ *                         "Postcondition is not satisfied: ...", ...);
  */
-# define BT_ASSERT_POST_MSG(_fmt, ...)                                 \
+#define BT_ASSERT_POST_MSG(_fmt, ...)                                  \
        do {                                                            \
                bt_lib_log(_BT_LOG_SRCLOC_FUNCTION, __FILE__,           \
                        __LINE__, BT_LOG_FATAL, BT_LOG_TAG,             \
@@ -79,8 +78,7 @@
        } while (0)
 
 /*
- * Developer mode: asserts that the library postcondition `_cond` is
- * satisfied.
+ * Asserts that the library postcondition `_cond` is satisfied.
  *
  * If `_cond` is false, log a fatal statement using `_fmt` and the
  * optional arguments (same usage as BT_LIB_LOGF()), and abort.
  * To assert that an internal postcondition is satisfied, use
  * BT_ASSERT().
  */
-# define BT_ASSERT_POST(_cond, _fmt, ...)                              \
+#define BT_ASSERT_POST(_cond, _fmt, ...)                               \
        do {                                                            \
                if (!(_cond)) {                                         \
                        BT_ASSERT_POST_MSG("Babeltrace 2 library postcondition not satisfied; error is:"); \
-                       BT_ASSERT_POST_MSG((_fmt), ##__VA_ARGS__);      \
+                       BT_ASSERT_POST_MSG(_fmt, ##__VA_ARGS__);        \
                        BT_ASSERT_POST_MSG("Aborting...");              \
                        abort();                                        \
                }                                                       \
  * Marks a function as being only used within a BT_ASSERT_POST()
  * context.
  */
-# define BT_ASSERT_POST_FUNC
+#define BT_ASSERT_POST_FUNC
+
+#ifdef BT_DEV_MODE
+/* Developer mode version of BT_ASSERT_POST_MSG(). */
+# define BT_ASSERT_POST_DEV_MSG(_fmt, ...)                             \
+       BT_ASSERT_POST_MSG(_fmt, ##__VA_ARGS__)
+
+/* Developer mode version of BT_ASSERT_POST(). */
+# define BT_ASSERT_POST_DEV(_cond, _fmt, ...)                          \
+       BT_ASSERT_POST((_cond), _fmt, ##__VA_ARGS__)
+
+/* Developer mode version of `BT_ASSERT_POST_FUNC`. */
+# define BT_ASSERT_POST_DEV_FUNC BT_ASSERT_POST_FUNC
 #else
-# define BT_ASSERT_POST(_cond, _fmt, ...)      ((void) sizeof((void) (_cond), 0))
-# define BT_ASSERT_POST_FUNC   __attribute__((unused))
-# define BT_ASSERT_POST_MSG(_fmt, ...)
+# define BT_ASSERT_POST_DEV_MSG(_fmt, ...)
+# define BT_ASSERT_POST_DEV(_cond, _fmt, ...)  ((void) sizeof((void) (_cond), 0))
+# define BT_ASSERT_POST_DEV_FUNC       __attribute__((unused))
 #endif /* BT_DEV_MODE */
 
 #define BT_ASSERT_POST_SUPPORTED
index 1cb0fec79d1ae8c38dbc64e0cff0b736073149a4..17ee8a89ad74ac27c96d64155412a9c5e6972ad6 100644 (file)
@@ -43,7 +43,6 @@
 #include <inttypes.h>
 #include "common/macros.h"
 
-#ifdef BT_DEV_MODE
 /*
  * Prints the details of an unsatisfied precondition without immediately
  * aborting. You should use this within a function which checks
@@ -71,7 +70,7 @@
  *     BT_ASSERT_PRE(check_complex_precond(...),
  *                   "Precondition is not satisfied: ...", ...);
  */
-# define BT_ASSERT_PRE_MSG(_fmt, ...)                                  \
+#define BT_ASSERT_PRE_MSG(_fmt, ...)                                   \
        do {                                                            \
                bt_lib_log(_BT_LOG_SRCLOC_FUNCTION, __FILE__,           \
                        __LINE__, BT_LOG_FATAL, BT_LOG_TAG,             \
@@ -79,8 +78,7 @@
        } while (0)
 
 /*
- * Developer mode: asserts that the library precondition `_cond` is
- * satisfied.
+ * Asserts that the library precondition `_cond` is satisfied.
  *
  * If `_cond` is false, log a fatal statement using `_fmt` and the
  * optional arguments (same usage as BT_LIB_LOGF()), and abort.
  * To assert that an internal postcondition is satisfied, use
  * BT_ASSERT().
  */
-# define BT_ASSERT_PRE(_cond, _fmt, ...)                               \
+#define BT_ASSERT_PRE(_cond, _fmt, ...)                                \
        do {                                                            \
                if (!(_cond)) {                                         \
                        BT_ASSERT_PRE_MSG("Babeltrace 2 library precondition not satisfied; error is:"); \
-                       BT_ASSERT_PRE_MSG((_fmt), ##__VA_ARGS__);       \
+                       BT_ASSERT_PRE_MSG(_fmt, ##__VA_ARGS__); \
                        BT_ASSERT_PRE_MSG("Aborting...");               \
                        abort();                                        \
                }                                                       \
        } while (0)
 
 /*
- * Marks a function as being only used within a BT_ASSERT_PRE() context.
+ * Asserts that a given variable `_obj` named `_obj_name` (capitalized)
+ * is not `NULL`.
  */
-# define BT_ASSERT_PRE_FUNC
-#else
-# define BT_ASSERT_PRE(_cond, _fmt, ...)       ((void) sizeof((void) (_cond), 0))
-# define BT_ASSERT_PRE_FUNC    __attribute__((unused))
-# define BT_ASSERT_PRE_MSG(_fmt, ...)
-#endif /* BT_DEV_MODE */
+#define BT_ASSERT_PRE_NON_NULL(_obj, _obj_name)                                \
+       BT_ASSERT_PRE((_obj) != NULL, "%s is NULL: ", _obj_name)
 
 /*
- * Developer mode: asserts that a given variable `_obj` named
- * `_obj_name` (capitalized) is not `NULL`.
+ * Asserts that a given index `_index` is less than a given length
+ * `_length`.
  */
-#define BT_ASSERT_PRE_NON_NULL(_obj, _obj_name)                                \
-       BT_ASSERT_PRE((_obj) != NULL, "%s is NULL: ", _obj_name)
+#define BT_ASSERT_PRE_VALID_INDEX(_index, _length)                     \
+       BT_ASSERT_PRE((_index) < (_length),                             \
+               "Index is out of bounds: index=%" PRIu64 ", "           \
+               "count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length))
+
+/*
+ * Marks a function as being only used within a BT_ASSERT_PRE() context.
+ */
+#define BT_ASSERT_PRE_FUNC
+
+#ifdef BT_DEV_MODE
+/* Developer mode version of BT_ASSERT_PRE_MSG(). */
+# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...)                                      \
+       BT_ASSERT_PRE_MSG(_fmt, #__VA_ARGS__)
+
+/* Developer mode version of BT_ASSERT_PRE(). */
+# define BT_ASSERT_PRE_DEV(_cond, _fmt, ...)                           \
+       BT_ASSERT_PRE((_cond), _fmt, #__VA_ARGS__)
+
+/* Developer mode version of BT_ASSERT_PRE_NON_NULL() */
+# define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name)                   \
+       BT_ASSERT_PRE_NON_NULL((_obj), (_obj_name))
 
 /*
  * Developer mode: asserts that a given object `_obj` named `_obj_name`
  * (capitalized) is NOT frozen. This macro checks the `frozen` field of
  * `_obj`.
+ *
+ * This currently only exists in developer mode because some freezing
+ * functions can be called on the fast path, so they too are only
+ * enabled in developer mode.
  */
-#define BT_ASSERT_PRE_HOT(_obj, _obj_name, _fmt, ...)                  \
+# define BT_ASSERT_PRE_DEV_HOT(_obj, _obj_name, _fmt, ...)             \
        BT_ASSERT_PRE(!(_obj)->frozen, "%s is frozen" _fmt, _obj_name,  \
                ##__VA_ARGS__)
 
-/*
- * Developer mode: asserts that a given index `_index` is less than a
- * given length `_length`.
- */
-#define BT_ASSERT_PRE_VALID_INDEX(_index, _length)                     \
-       BT_ASSERT_PRE((_index) < (_length),                             \
-               "Index is out of bounds: index=%" PRIu64 ", "           \
-               "count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length))
+/* Developer mode version of BT_ASSERT_PRE_VALID_INDEX() */
+# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length)                        \
+       BT_ASSERT_PRE_VALID_INDEX((_index), (_length))
+
+/* Developer mode version of `BT_ASSERT_PRE_FUNC`. */
+# define BT_ASSERT_PRE_DEV_FUNC
+#else
+# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...)
+# define BT_ASSERT_PRE_DEV(_cond, _fmt, ...)   ((void) sizeof((void) (_cond), 0))
+# define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name)                   \
+       ((void) sizeof((void) (_obj), (void) (_obj_name), 0))
+# define BT_ASSERT_PRE_DEV_HOT(_obj, _obj_name, _fmt, ...)             \
+       ((void) sizeof((void) (_obj), (void) (_obj_name), 0))
+# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length)                        \
+       ((void) sizeof((void) (_index), (void) (_length), 0))
+# define BT_ASSERT_PRE_DEV_FUNC                __attribute__((unused))
+#endif /* BT_DEV_MODE */
 
 #define BT_ASSERT_PRE_SUPPORTED
 
index 643c6a35807d37513da960b0c8a32392d5296fc0..5ede96f08a730bb532e97dbe4bb57a971d2a5f6b 100644 (file)
@@ -41,8 +41,8 @@
 #include "component-class.h"
 #include "lib/func-status.h"
 
-#define BT_ASSERT_PRE_COMP_CLS_HOT(_cc) \
-       BT_ASSERT_PRE_HOT(((const struct bt_component_class *) (_cc)),  \
+#define BT_ASSERT_PRE_DEV_COMP_CLS_HOT(_cc) \
+       BT_ASSERT_PRE_DEV_HOT(((const struct bt_component_class *) (_cc)), \
                "Component class", ": %!+C", (_cc))
 
 static
@@ -268,7 +268,7 @@ bt_component_class_source_set_init_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.init = method;
        BT_LIB_LOGD("Set source component class's initialization method: "
                "%!+C", comp_cls);
@@ -282,7 +282,7 @@ bt_component_class_filter_set_init_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.init = method;
        BT_LIB_LOGD("Set filter component class's initialization method: "
                "%!+C", comp_cls);
@@ -296,7 +296,7 @@ bt_component_class_sink_set_init_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.init = method;
        BT_LIB_LOGD("Set sink component class's initialization method: "
                "%!+C", comp_cls);
@@ -310,7 +310,7 @@ bt_component_class_source_set_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.finalize = method;
        BT_LIB_LOGD("Set source component class's finalization method: "
                "%!+C", comp_cls);
@@ -324,7 +324,7 @@ bt_component_class_filter_set_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.finalize = method;
        BT_LIB_LOGD("Set filter component class's finalization method: "
                "%!+C", comp_cls);
@@ -338,7 +338,7 @@ bt_component_class_sink_set_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.finalize = method;
        BT_LIB_LOGD("Set sink component class's finalization method: "
                "%!+C", comp_cls);
@@ -352,7 +352,7 @@ bt_component_class_source_set_query_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.query = method;
        BT_LIB_LOGD("Set source component class's query method: "
                "%!+C", comp_cls);
@@ -366,7 +366,7 @@ bt_component_class_filter_set_query_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.query = method;
        BT_LIB_LOGD("Set filter component class's query method: "
                "%!+C", comp_cls);
@@ -380,7 +380,7 @@ bt_component_class_sink_set_query_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.query = method;
        BT_LIB_LOGD("Set sink component class's query method: "
                "%!+C", comp_cls);
@@ -394,7 +394,7 @@ bt_component_class_filter_set_input_port_connected_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.input_port_connected = method;
        BT_LIB_LOGD("Set filter component class's \"input port connected\" method"
                ": %!+C", comp_cls);
@@ -408,7 +408,7 @@ bt_component_class_sink_set_input_port_connected_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.input_port_connected = method;
        BT_LIB_LOGD("Set sink component class's \"input port connected\" method"
                ": %!+C", comp_cls);
@@ -422,7 +422,7 @@ bt_component_class_source_set_output_port_connected_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.output_port_connected = method;
        BT_LIB_LOGD("Set source component class's \"output port connected\" method"
                ": %!+C", comp_cls);
@@ -436,7 +436,7 @@ bt_component_class_filter_set_output_port_connected_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.output_port_connected = method;
        BT_LIB_LOGD("Set filter component class's \"output port connected\" method"
                ": %!+C", comp_cls);
@@ -450,7 +450,7 @@ bt_component_class_sink_set_graph_is_configured_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.graph_is_configured = method;
        BT_LIB_LOGD("Set sink component class's \"graph is configured\" method"
                ": %!+C", comp_cls);
@@ -464,7 +464,7 @@ bt_component_class_source_set_message_iterator_init_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_init = method;
        BT_LIB_LOGD("Set source component class's message iterator initialization method"
                ": %!+C", comp_cls);
@@ -478,7 +478,7 @@ bt_component_class_filter_set_message_iterator_init_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_init = method;
        BT_LIB_LOGD("Set filter component class's message iterator initialization method"
                ": %!+C", comp_cls);
@@ -492,7 +492,7 @@ bt_component_class_source_set_message_iterator_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_finalize = method;
        BT_LIB_LOGD("Set source component class's message iterator finalization method"
                ": %!+C", comp_cls);
@@ -506,7 +506,7 @@ bt_component_class_filter_set_message_iterator_finalize_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_finalize = method;
        BT_LIB_LOGD("Set filter component class's message iterator finalization method"
                ": %!+C", comp_cls);
@@ -520,7 +520,7 @@ bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_seek_ns_from_origin = method;
        BT_LIB_LOGD("Set filter component class's message iterator \"seek nanoseconds from origin\" method"
                ": %!+C", comp_cls);
@@ -534,7 +534,7 @@ bt_component_class_source_set_message_iterator_seek_ns_from_origin_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_seek_ns_from_origin = method;
        BT_LIB_LOGD("Set source component class's message iterator \"seek nanoseconds from origin\" method"
                ": %!+C", comp_cls);
@@ -548,7 +548,7 @@ bt_component_class_filter_set_message_iterator_seek_beginning_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_seek_beginning = method;
        BT_LIB_LOGD("Set filter component class's message iterator \"seek beginning\" method"
                ": %!+C", comp_cls);
@@ -562,7 +562,7 @@ bt_component_class_source_set_message_iterator_seek_beginning_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_seek_beginning = method;
        BT_LIB_LOGD("Set source component class's message iterator \"seek beginning\" method"
                ": %!+C", comp_cls);
@@ -576,7 +576,7 @@ bt_component_class_filter_set_message_iterator_can_seek_beginning_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_can_seek_beginning = method;
        BT_LIB_LOGD("Set filter component class's message iterator \"can seek beginning\" method"
                ": %!+C", comp_cls);
@@ -590,7 +590,7 @@ bt_component_class_source_set_message_iterator_can_seek_beginning_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_can_seek_beginning = method;
        BT_LIB_LOGD("Set source component class's message iterator \"can seek beginning\" method"
                ": %!+C", comp_cls);
@@ -604,7 +604,7 @@ bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_can_seek_ns_from_origin = method;
        BT_LIB_LOGD("Set filter component class's message iterator \"can seek nanoseconds from origin\" method"
                ": %!+C", comp_cls);
@@ -618,7 +618,7 @@ bt_component_class_source_set_message_iterator_can_seek_ns_from_origin_method(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        comp_cls->methods.msg_iter_can_seek_ns_from_origin = method;
        BT_LIB_LOGD("Set source component class's message iterator \"can seek nanoseconds from origin\" method"
                ": %!+C", comp_cls);
@@ -632,7 +632,7 @@ bt_component_class_set_description(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(description, "Description");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        g_string_assign(comp_cls->description, description);
        BT_LIB_LOGD("Set component class's description: "
                "addr=%p, name=\"%s\", type=%s",
@@ -648,7 +648,7 @@ enum bt_component_class_set_help_status bt_component_class_set_help(
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(help, "Help");
-       BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
+       BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
        g_string_assign(comp_cls->help, help);
        BT_LIB_LOGD("Set component class's help text: %!+C", comp_cls);
        return BT_FUNC_STATUS_OK;
@@ -656,21 +656,21 @@ enum bt_component_class_set_help_status bt_component_class_set_help(
 
 const char *bt_component_class_get_name(const struct bt_component_class *comp_cls)
 {
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
        return comp_cls->name->str;
 }
 
 enum bt_component_class_type bt_component_class_get_type(
                const struct bt_component_class *comp_cls)
 {
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
        return comp_cls->type;
 }
 
 const char *bt_component_class_get_description(
                const struct bt_component_class *comp_cls)
 {
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
        return comp_cls->description &&
                comp_cls->description->str[0] != '\0' ?
                comp_cls->description->str : NULL;
@@ -679,7 +679,7 @@ const char *bt_component_class_get_description(
 const char *bt_component_class_get_help(
                const struct bt_component_class *comp_cls)
 {
-       BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp_cls, "Component class");
        return comp_cls->help &&
                comp_cls->help->str[0] != '\0' ? comp_cls->help->str : NULL;
 }
index 20f7929ec379efe39797a14b779855fdf6502a23..df617c6866ffcd25f6d9858a6618a9d2e2fbbc86 100644 (file)
@@ -65,7 +65,7 @@ bt_component_filter_borrow_class_const(
 {
        struct bt_component_class *cls;
 
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
 
        cls = component->parent.class;
 
index 9c66bda7932b1f2ea30c6da8fef05ea4cd60dd79..b218144d145d863f3630843c21880a3b6d2e6d87 100644 (file)
@@ -64,7 +64,7 @@ bt_component_sink_borrow_class_const(
 {
        struct bt_component_class *cls;
 
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
 
        cls = component->parent.class;
 
index e81a143aec4c3f79b11f3f8d6a7fb5271acf1cd7..7e8ceb5645f4d693aa3012b121c16c79e6045d22 100644 (file)
@@ -65,7 +65,7 @@ bt_component_source_borrow_class_const(
 {
        struct bt_component_class *cls;
 
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
 
        cls = component->parent.class;
 
index 0d13566a2a8231e561072291c6c39949eea63269..b780d1bf4388112723b774a075df6baa6c270c5e 100644 (file)
@@ -190,7 +190,7 @@ void destroy_component(struct bt_object *obj)
 enum bt_component_class_type bt_component_get_class_type(
                const struct bt_component *component)
 {
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
        return component->class->type;
 }
 
@@ -273,14 +273,14 @@ end:
 BT_HIDDEN
 uint64_t bt_component_get_input_port_count(const struct bt_component *comp)
 {
-       BT_ASSERT_PRE_NON_NULL(comp, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
        return (uint64_t) comp->input_ports->len;
 }
 
 BT_HIDDEN
 uint64_t bt_component_get_output_port_count(const struct bt_component *comp)
 {
-       BT_ASSERT_PRE_NON_NULL(comp, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
        return (uint64_t) comp->output_ports->len;
 }
 
@@ -355,14 +355,14 @@ end:
 
 const char *bt_component_get_name(const struct bt_component *component)
 {
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
        return component->name->str;
 }
 
 const struct bt_component_class *bt_component_borrow_class_const(
                const struct bt_component *component)
 {
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
        return component->class;
 }
 
@@ -370,7 +370,7 @@ void *bt_self_component_get_data(const struct bt_self_component *self_comp)
 {
        struct bt_component *component = (void *) self_comp;
 
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
        return component->user_data;
 }
 
@@ -379,7 +379,7 @@ void bt_self_component_set_data(struct bt_self_component *self_comp,
 {
        struct bt_component *component = (void *) self_comp;
 
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
        component->user_data = data;
        BT_LIB_LOGD("Set component's user data: %!+c", component);
 }
@@ -431,7 +431,7 @@ BT_HIDDEN
 struct bt_port_output *bt_component_borrow_output_port_by_name(
                struct bt_component *comp, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(comp, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
        return (void *)
                borrow_port_by_name(comp->output_ports, name);
 }
@@ -447,8 +447,8 @@ BT_HIDDEN
 struct bt_port_input *bt_component_borrow_input_port_by_index(
                struct bt_component *comp, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(comp, "Component");
-       BT_ASSERT_PRE_VALID_INDEX(index, comp->input_ports->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp->input_ports->len);
        return (void *)
                borrow_port_by_index(comp->input_ports, index);
 }
@@ -457,8 +457,8 @@ BT_HIDDEN
 struct bt_port_output *bt_component_borrow_output_port_by_index(
                struct bt_component *comp, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(comp, "Component");
-       BT_ASSERT_PRE_VALID_INDEX(index, comp->output_ports->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(comp, "Component");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp->output_ports->len);
        return (void *)
                borrow_port_by_index(comp->output_ports, index);
 }
@@ -610,7 +610,7 @@ void bt_component_remove_destroy_listener(struct bt_component *component,
 bt_logging_level bt_component_get_logging_level(
                const struct bt_component *component)
 {
-       BT_ASSERT_PRE_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
        return component->log_level;
 }
 
index 41fbcc6984cb877009bc2d710af1d91b2329fc60..a50828fbdc415be82d11e798ba6c5be9c5b597b5 100644 (file)
@@ -232,14 +232,14 @@ void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph)
 const struct bt_port_output *bt_connection_borrow_upstream_port_const(
                const struct bt_connection *connection)
 {
-       BT_ASSERT_PRE_NON_NULL(connection, "Connection");
+       BT_ASSERT_PRE_DEV_NON_NULL(connection, "Connection");
        return (void *) connection->upstream_port;
 }
 
 const struct bt_port_input *bt_connection_borrow_downstream_port_const(
                const struct bt_connection *connection)
 {
-       BT_ASSERT_PRE_NON_NULL(connection, "Connection");
+       BT_ASSERT_PRE_DEV_NON_NULL(connection, "Connection");
        return (void *) connection->downstream_port;
 }
 
index cf112fbd8393907c0f7a8f5637188fadeec0f606..076fc5fd1a439a2d7d2f088d18c1e2618321bbf6 100644 (file)
@@ -564,7 +564,7 @@ int consume_graph_sink(struct bt_component_sink *comp)
        consume_status = sink_class->methods.consume((void *) comp);
        BT_LOGD("User method returned: status=%s",
                bt_common_func_status_string(consume_status));
-       BT_ASSERT_POST(consume_status == BT_FUNC_STATUS_OK ||
+       BT_ASSERT_POST_DEV(consume_status == BT_FUNC_STATUS_OK ||
                consume_status == BT_FUNC_STATUS_END ||
                consume_status == BT_FUNC_STATUS_AGAIN ||
                consume_status == BT_FUNC_STATUS_ERROR ||
@@ -663,7 +663,7 @@ int consume_no_check(struct bt_graph *graph)
        struct bt_component *sink;
        GList *current_node;
 
-       BT_ASSERT_PRE(graph->has_sink,
+       BT_ASSERT_PRE_DEV(graph->has_sink,
                "Graph has no sink component: %!+g", graph);
        BT_LIB_LOGD("Making next sink component consume: %![graph-]+g", graph);
 
@@ -686,11 +686,12 @@ enum bt_graph_consume_status bt_graph_consume(struct bt_graph *graph)
 {
        enum bt_graph_consume_status status;
 
-       BT_ASSERT_PRE_NON_NULL(graph, "Graph");
-       BT_ASSERT_PRE(!graph->canceled, "Graph is canceled: %!+g", graph);
-       BT_ASSERT_PRE(graph->can_consume,
+       BT_ASSERT_PRE_DEV_NON_NULL(graph, "Graph");
+       BT_ASSERT_PRE_DEV(!graph->canceled, "Graph is canceled: %!+g", graph);
+       BT_ASSERT_PRE_DEV(graph->can_consume,
                "Cannot consume graph in its current state: %!+g", graph);
-       BT_ASSERT_PRE(graph->config_state != BT_GRAPH_CONFIGURATION_STATE_FAULTY,
+       BT_ASSERT_PRE_DEV(graph->config_state !=
+               BT_GRAPH_CONFIGURATION_STATE_FAULTY,
                "Graph is in a faulty state: %!+g", graph);
        bt_graph_set_can_consume(graph, false);
        status = bt_graph_configure(graph);
@@ -1218,7 +1219,7 @@ enum bt_graph_cancel_status bt_graph_cancel(struct bt_graph *graph)
 
 bt_bool bt_graph_is_canceled(const struct bt_graph *graph)
 {
-       BT_ASSERT_PRE_NON_NULL(graph, "Graph");
+       BT_ASSERT_PRE_DEV_NON_NULL(graph, "Graph");
        return graph->canceled ? BT_TRUE : BT_FALSE;
 }
 
index ef847361e16dcd352b10abf12f3444bedcb6afb1..74c794707206e6770fa12f616ead62c74e3bfa9e 100644 (file)
@@ -145,18 +145,12 @@ struct bt_graph {
 };
 
 static inline
-void _bt_graph_set_can_consume(struct bt_graph *graph, bool can_consume)
+void bt_graph_set_can_consume(struct bt_graph *graph, bool can_consume)
 {
        BT_ASSERT(graph);
        graph->can_consume = can_consume;
 }
 
-#ifdef BT_DEV_MODE
-# define bt_graph_set_can_consume      _bt_graph_set_can_consume
-#else
-# define bt_graph_set_can_consume(_graph, _can_consume)
-#endif
-
 BT_HIDDEN
 int bt_graph_consume_sink_no_check(struct bt_graph *graph,
                struct bt_component_sink *sink);
index 41805663d40dfa1d8a0b85c4d3125ab42c5a25e8..3ae5920851c9af08986c67a5fb678acd3d07882c 100644 (file)
@@ -526,7 +526,7 @@ void *bt_self_message_iterator_get_data(
        struct bt_self_component_port_input_message_iterator *iterator =
                (void *) self_iterator;
 
-       BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+       BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
        return iterator->user_data;
 }
 
@@ -536,7 +536,7 @@ void bt_self_message_iterator_set_data(
        struct bt_self_component_port_input_message_iterator *iterator =
                (void *) self_iterator;
 
-       BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+       BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
        iterator->user_data = data;
        BT_LIB_LOGD("Set message iterator's user data: "
                "%!+i, user-data-addr=%p", iterator, data);
@@ -547,7 +547,7 @@ void bt_self_message_iterator_set_data(
  * time.
  */
 
-BT_ASSERT_POST_FUNC
+BT_ASSERT_POST_DEV_FUNC
 static
 bool clock_snapshots_are_monotonic_one(
                struct bt_self_component_port_input_message_iterator *iterator,
@@ -622,7 +622,7 @@ end:
        return result;
 }
 
-BT_ASSERT_POST_FUNC
+BT_ASSERT_POST_DEV_FUNC
 static
 bool clock_snapshots_are_monotonic(
                struct bt_self_component_port_input_message_iterator *iterator,
@@ -649,7 +649,7 @@ end:
  * stream is compatible with what we've seen before.
  */
 
-BT_ASSERT_POST_FUNC
+BT_ASSERT_POST_DEV_FUNC
 static
 bool clock_classes_are_compatible_one(struct bt_self_component_port_input_message_iterator *iterator,
                const struct bt_message *msg)
@@ -689,7 +689,8 @@ bool clock_classes_are_compatible_one(struct bt_self_component_port_input_messag
 
                case CLOCK_EXPECTATION_NONE:
                        if (clock_class) {
-                               BT_ASSERT_POST_MSG("Expecting no clock class, got one: %![cc-]+K",
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting no clock class, got one: %![cc-]+K",
                                        clock_class);
                                result = false;
                                goto end;
@@ -699,13 +700,15 @@ bool clock_classes_are_compatible_one(struct bt_self_component_port_input_messag
 
                case CLOCK_EXPECTATION_ORIGIN_UNIX:
                        if (!clock_class) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class, got none.");
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class, got none.");
                                result = false;
                                goto end;
                        }
 
                        if (!bt_clock_class_origin_is_unix_epoch(clock_class)) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class with Unix epoch origin: %![cc-]+K",
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class with Unix epoch origin: %![cc-]+K",
                                        clock_class);
                                result = false;
                                goto end;
@@ -714,27 +717,31 @@ bool clock_classes_are_compatible_one(struct bt_self_component_port_input_messag
 
                case CLOCK_EXPECTATION_ORIGIN_OTHER_UUID:
                        if (!clock_class) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class, got none.");
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class, got none.");
                                result = false;
                                goto end;
                        }
 
                        if (bt_clock_class_origin_is_unix_epoch(clock_class)) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class without Unix epoch origin: %![cc-]+K",
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class without Unix epoch origin: %![cc-]+K",
                                        clock_class);
                                result = false;
                                goto end;
                        }
 
                        if (!clock_class_uuid) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class with UUID: %![cc-]+K",
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class with UUID: %![cc-]+K",
                                        clock_class);
                                result = false;
                                goto end;
                        }
 
                        if (bt_uuid_compare(iterator->clock_expectation.uuid, clock_class_uuid)) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class with UUID, got one "
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class with UUID, got one "
                                        "with a different UUID: %![cc-]+K, expected-uuid=%!u",
                                        clock_class, iterator->clock_expectation.uuid);
                                result = false;
@@ -744,20 +751,23 @@ bool clock_classes_are_compatible_one(struct bt_self_component_port_input_messag
 
                case CLOCK_EXPECTATION_ORIGIN_OTHER_NO_UUID:
                        if (!clock_class) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class, got none.");
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class, got none.");
                                result = false;
                                goto end;
                        }
 
                        if (bt_clock_class_origin_is_unix_epoch(clock_class)) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class without Unix epoch origin: %![cc-]+K",
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class without Unix epoch origin: %![cc-]+K",
                                        clock_class);
                                result = false;
                                goto end;
                        }
 
                        if (clock_class_uuid) {
-                               BT_ASSERT_POST_MSG("Expecting a clock class without UUID: %![cc-]+K",
+                               BT_ASSERT_POST_DEV_MSG(
+                                       "Expecting a clock class without UUID: %![cc-]+K",
                                        clock_class);
                                result = false;
                                goto end;
@@ -772,7 +782,7 @@ end:
        return result;
 }
 
-BT_ASSERT_POST_FUNC
+BT_ASSERT_POST_DEV_FUNC
 static
 bool clock_classes_are_compatible(
                struct bt_self_component_port_input_message_iterator *iterator,
@@ -814,9 +824,9 @@ call_iterator_next_method(
                bt_common_func_status_string(status), *user_count);
 
        if (status == BT_FUNC_STATUS_OK) {
-               BT_ASSERT_POST(clock_classes_are_compatible(iterator, msgs, *user_count),
+               BT_ASSERT_POST_DEV(clock_classes_are_compatible(iterator, msgs, *user_count),
                        "Clocks are not compatible");
-               BT_ASSERT_POST(clock_snapshots_are_monotonic(iterator, msgs, *user_count),
+               BT_ASSERT_POST_DEV(clock_snapshots_are_monotonic(iterator, msgs, *user_count),
                        "Clock snapshots are not monotonic");
        }
 
@@ -830,16 +840,16 @@ bt_self_component_port_input_message_iterator_next(
 {
        enum bt_message_iterator_next_status status = BT_FUNC_STATUS_OK;
 
-       BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
-       BT_ASSERT_PRE_NON_NULL(msgs, "Message array (output)");
-       BT_ASSERT_PRE_NON_NULL(user_count, "Message count (output)");
-       BT_ASSERT_PRE(iterator->state ==
+       BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
+       BT_ASSERT_PRE_DEV_NON_NULL(msgs, "Message array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(user_count, "Message count (output)");
+       BT_ASSERT_PRE_DEV(iterator->state ==
                BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_ACTIVE,
                "Message iterator's \"next\" called, but "
                "message iterator is in the wrong state: %!+i", iterator);
        BT_ASSERT(iterator->upstream_component);
        BT_ASSERT(iterator->upstream_component->class);
-       BT_ASSERT_PRE(
+       BT_ASSERT_PRE_DEV(
                bt_component_borrow_graph(iterator->upstream_component)->config_state !=
                        BT_GRAPH_CONFIGURATION_STATE_CONFIGURING,
                "Graph is not configured: %!+g",
@@ -880,7 +890,7 @@ bt_self_component_port_input_message_iterator_next(
 
        switch (status) {
        case BT_FUNC_STATUS_OK:
-               BT_ASSERT_POST(*user_count <= MSG_BATCH_SIZE,
+               BT_ASSERT_POST_DEV(*user_count <= MSG_BATCH_SIZE,
                        "Invalid returned message count: greater than "
                        "batch size: count=%" PRIu64 ", batch-size=%u",
                        *user_count, MSG_BATCH_SIZE);
@@ -909,9 +919,9 @@ enum bt_message_iterator_next_status bt_port_output_message_iterator_next(
        enum bt_message_iterator_next_status status;
        int graph_status;
 
-       BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
-       BT_ASSERT_PRE_NON_NULL(msgs_to_user, "Message array (output)");
-       BT_ASSERT_PRE_NON_NULL(count_to_user, "Message count (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
+       BT_ASSERT_PRE_DEV_NON_NULL(msgs_to_user, "Message array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(count_to_user, "Message count (output)");
        BT_LIB_LOGD("Getting next output port message iterator's messages: "
                "%!+i", iterator);
        graph_status = bt_graph_consume_sink_no_check(iterator->graph,
@@ -946,7 +956,7 @@ struct bt_component *
 bt_self_component_port_input_message_iterator_borrow_component(
                struct bt_self_component_port_input_message_iterator *iterator)
 {
-       BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+       BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
        return iterator->upstream_component;
 }
 
@@ -954,7 +964,7 @@ const struct bt_component *
 bt_self_component_port_input_message_iterator_borrow_component_const(
                const struct bt_self_component_port_input_message_iterator *iterator)
 {
-       BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+       BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
        return iterator->upstream_component;
 }
 
@@ -964,7 +974,7 @@ struct bt_self_component *bt_self_message_iterator_borrow_component(
        struct bt_self_component_port_input_message_iterator *iterator =
                (void *) self_iterator;
 
-       BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+       BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
        return (void *) iterator->upstream_component;
 }
 
@@ -974,7 +984,7 @@ struct bt_self_port_output *bt_self_message_iterator_borrow_port(
        struct bt_self_component_port_input_message_iterator *iterator =
                (void *) self_iterator;
 
-       BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
+       BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
        return (void *) iterator->upstream_port;
 }
 
@@ -1373,7 +1383,7 @@ int auto_seek_handle_message(
                        (const void *) msg;
 
                clk_snapshot = event_msg->default_cs;
-               BT_ASSERT_POST(clk_snapshot,
+               BT_ASSERT_POST_DEV(clk_snapshot,
                        "Event message has no default clock snapshot: %!+n",
                        event_msg);
                break;
@@ -1394,7 +1404,7 @@ int auto_seek_handle_message(
                        (const void *) msg;
 
                clk_snapshot = packet_msg->default_cs;
-               BT_ASSERT_POST(clk_snapshot,
+               BT_ASSERT_POST_DEV(clk_snapshot,
                        "Packet message has no default clock snapshot: %!+n",
                        packet_msg);
                break;
@@ -1405,7 +1415,7 @@ int auto_seek_handle_message(
                struct bt_message_discarded_items *msg_disc_items =
                        (void *) msg;
 
-               BT_ASSERT_POST(msg_disc_items->default_begin_cs &&
+               BT_ASSERT_POST_DEV(msg_disc_items->default_begin_cs &&
                        msg_disc_items->default_end_cs,
                        "Discarded events/packets message has no default clock snapshots: %!+n",
                        msg_disc_items);
@@ -1675,7 +1685,7 @@ int find_message_ge_ns_from_origin(
 
                switch (status) {
                case BT_FUNC_STATUS_OK:
-                       BT_ASSERT_POST(user_count <= MSG_BATCH_SIZE,
+                       BT_ASSERT_POST_DEV(user_count <= MSG_BATCH_SIZE,
                                "Invalid returned message count: greater than "
                                "batch size: count=%" PRIu64 ", batch-size=%u",
                                user_count, MSG_BATCH_SIZE);
index 1658b55a9d829bd3978a0f3f3c14c0f2ce62d62c..957861d1c98d92958ddeb88e951532cc8d6426fc 100644 (file)
@@ -173,7 +173,7 @@ void set_discarded_items_message_count(struct bt_message *message,
        struct bt_message_discarded_items *disc_items_msg = (void *) message;
 
        BT_ASSERT(message);
-       BT_ASSERT_PRE_HOT(message, "Message", ": %!+n", message);
+       BT_ASSERT_PRE_DEV_HOT(message, "Message", ": %!+n", message);
        bt_property_uint_set(&disc_items_msg->count, count);
 }
 
@@ -183,7 +183,7 @@ enum bt_property_availability get_discarded_items_message_count(
 {
        struct bt_message_discarded_items *disc_items_msg = (void *) message;
 
-       BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
        BT_ASSERT(message);
        *count = disc_items_msg->count.value;
        return disc_items_msg->count.base.avail;
@@ -197,7 +197,7 @@ borrow_discarded_items_message_beginning_default_clock_snapshot_const(
        struct bt_message_discarded_items *disc_items_msg = (void *) message;
 
        BT_ASSERT(message);
-       BT_ASSERT_PRE(disc_items_msg->stream->class->default_clock_class,
+       BT_ASSERT_PRE_DEV(disc_items_msg->stream->class->default_clock_class,
                "Message's stream's class has no default clock class: "
                "%![msg-]+n, %![sc-]+S",
                message, disc_items_msg->stream->class);
@@ -212,7 +212,7 @@ borrow_discarded_items_message_end_default_clock_snapshot_const(
        struct bt_message_discarded_items *disc_items_msg = (void *) message;
 
        BT_ASSERT(message);
-       BT_ASSERT_PRE(disc_items_msg->stream->class->default_clock_class,
+       BT_ASSERT_PRE_DEV(disc_items_msg->stream->class->default_clock_class,
                "Message's stream's class has no default clock class: "
                "%![msg-]+n, %![sc-]+S",
                message, disc_items_msg->stream->class);
@@ -241,8 +241,8 @@ struct bt_message *bt_message_discarded_events_create_with_default_clock_snapsho
 struct bt_stream *bt_message_discarded_events_borrow_stream(
                struct bt_message *message)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
        return borrow_discarded_items_message_stream(message);
 }
 
@@ -258,8 +258,8 @@ const struct bt_clock_snapshot *
 bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
        return borrow_discarded_items_message_beginning_default_clock_snapshot_const(
                msg);
 }
@@ -268,8 +268,8 @@ const struct bt_clock_snapshot *
 bt_message_discarded_events_borrow_end_default_clock_snapshot_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
        return borrow_discarded_items_message_end_default_clock_snapshot_const(
                msg);
 }
@@ -284,8 +284,9 @@ bt_message_discarded_events_borrow_stream_const(const struct bt_message *message
 enum bt_property_availability bt_message_discarded_events_get_count(
                const struct bt_message *message, uint64_t *count)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message,
+               BT_MESSAGE_TYPE_DISCARDED_EVENTS);
        return get_discarded_items_message_count(message, count);
 }
 
@@ -311,8 +312,9 @@ struct bt_message *bt_message_discarded_packets_create_with_default_clock_snapsh
 struct bt_stream *bt_message_discarded_packets_borrow_stream(
                struct bt_message *message)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message,
+               BT_MESSAGE_TYPE_DISCARDED_PACKETS);
        return borrow_discarded_items_message_stream(message);
 }
 
@@ -328,8 +330,8 @@ const struct bt_clock_snapshot *
 bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
        return borrow_discarded_items_message_beginning_default_clock_snapshot_const(
                msg);
 }
@@ -338,8 +340,8 @@ const struct bt_clock_snapshot *
 bt_message_discarded_packets_borrow_end_default_clock_snapshot_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
        return borrow_discarded_items_message_end_default_clock_snapshot_const(
                msg);
 }
@@ -354,8 +356,9 @@ bt_message_discarded_packets_borrow_stream_const(const struct bt_message *messag
 enum bt_property_availability bt_message_discarded_packets_get_count(
                const struct bt_message *message, uint64_t *count)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message,
+               BT_MESSAGE_TYPE_DISCARDED_PACKETS);
        return get_discarded_items_message_count(message, count);
 }
 
@@ -374,8 +377,8 @@ const struct bt_clock_class *
 bt_message_discarded_events_borrow_stream_class_default_clock_class_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
        return borrow_discarded_items_message_stream_class_default_clock_class(
                msg);
 }
@@ -384,8 +387,8 @@ const struct bt_clock_class *
 bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
        return borrow_discarded_items_message_stream_class_default_clock_class(
                msg);
 }
index 5f3c90d4912a83bb6a9d67e8e0f6d77e211afcd0..54254e77fb27e133b66e0922aa5ab44265d5280f 100644 (file)
@@ -271,8 +271,8 @@ struct bt_event *borrow_event(struct bt_message *message)
 {
        struct bt_message_event *event_message;
 
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_EVENT);
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_EVENT);
        event_message = container_of(message,
                        struct bt_message_event, parent);
        return event_message->event;
@@ -297,12 +297,12 @@ bt_message_event_borrow_default_clock_snapshot_const(
        struct bt_message_event *event_msg = (void *) msg;
        struct bt_stream_class *stream_class;
 
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_EVENT);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_EVENT);
        stream_class = bt_event_class_borrow_stream_class_inline(
                event_msg->event->class);
        BT_ASSERT(stream_class);
-       BT_ASSERT_PRE(stream_class->default_clock_class,
+       BT_ASSERT_PRE_DEV(stream_class->default_clock_class,
                "Message's stream's class has no default clock class: "
                "%![msg-]+n, %![sc-]+S", msg, stream_class);
        return event_msg->default_cs;
@@ -315,8 +315,8 @@ bt_message_event_borrow_stream_class_default_clock_class_const(
        struct bt_message_event *event_msg = (void *) msg;
        struct bt_stream_class *stream_class;
 
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_EVENT);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_EVENT);
        stream_class = bt_event_class_borrow_stream_class_inline(
                event_msg->event->class);
        BT_ASSERT(stream_class);
index 71afff63062d40d39a0a4050d8912a01eeb005b4..adfa4c574ea4675886f8fe43e1f0f9f279ea05c9 100644 (file)
@@ -101,7 +101,8 @@ bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
 {
        struct bt_message_message_iterator_inactivity *inactivity = (void *) msg;
 
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg,
+               BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY);
        return inactivity->default_cs;
 }
index 285bf8f8367e88d46ab17748d70766ab3aee9ca5..5d1d8139b41eb7afad891809949b3c174a7afb1b 100644 (file)
@@ -50,7 +50,7 @@ void bt_message_init(struct bt_message *message,
 enum bt_message_type bt_message_get_type(
                const struct bt_message *message)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
        return message->type;
 }
 
index a1e529974594aeb14a9e4308c2c783602318acdb..75515ef8f41ffc224033fde627bd59ffc44eb0a7 100644 (file)
@@ -55,11 +55,23 @@ struct bt_message {
        struct bt_graph *graph;
 };
 
-#define BT_ASSERT_PRE_MSG_IS_TYPE(_msg, _type)                 \
-       BT_ASSERT_PRE(((struct bt_message *) (_msg))->type == (_type), \
-               "Message has the wrong type: expected-type=%s, "        \
-               "%![msg-]+n", bt_message_type_string(_type),    \
-               (_msg))
+#define _BT_ASSERT_PRE_MSG_IS_TYPE_COND(_msg, _type)                   \
+       (((struct bt_message *) (_msg))->type == (_type))
+
+#define _BT_ASSERT_PRE_MSG_IS_TYPE_FMT                                 \
+       "Message has the wrong type: expected-type=%s, %![msg-]+n"
+
+#define BT_ASSERT_PRE_MSG_IS_TYPE(_msg, _type)                         \
+       BT_ASSERT_PRE(                                                  \
+               _BT_ASSERT_PRE_MSG_IS_TYPE_COND((_msg), (_type)),       \
+               _BT_ASSERT_PRE_MSG_IS_TYPE_FMT,                         \
+               bt_message_type_string(_type), (_msg))
+
+#define BT_ASSERT_PRE_DEV_MSG_IS_TYPE(_msg, _type)                     \
+       BT_ASSERT_PRE_DEV(                                              \
+               _BT_ASSERT_PRE_MSG_IS_TYPE_COND((_msg), (_type)),       \
+               _BT_ASSERT_PRE_MSG_IS_TYPE_FMT,                         \
+               bt_message_type_string(_type), (_msg))
 
 BT_HIDDEN
 void bt_message_init(struct bt_message *message,
index b00f2dfc0b7026c540affb5787f21d7c79377387..56808d0e477d5a54e5f335bf2ac2776fcb0f2d64 100644 (file)
@@ -280,8 +280,8 @@ struct bt_packet *bt_message_packet_beginning_borrow_packet(
 {
        struct bt_message_packet *packet_msg = (void *) message;
 
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message,
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message,
                BT_MESSAGE_TYPE_PACKET_BEGINNING);
        return packet_msg->packet;
 }
@@ -298,8 +298,8 @@ struct bt_packet *bt_message_packet_end_borrow_packet(
 {
        struct bt_message_packet *packet_msg = (void *) message;
 
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message,
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message,
                BT_MESSAGE_TYPE_PACKET_END);
        return packet_msg->packet;
 }
@@ -319,7 +319,8 @@ borrow_packet_message_default_clock_snapshot_const(
        struct bt_message_packet *packet_msg = (void *) message;
 
        BT_ASSERT(message);
-       BT_ASSERT_PRE(packet_msg->packet->stream->class->default_clock_class,
+       BT_ASSERT_PRE_DEV(
+               packet_msg->packet->stream->class->default_clock_class,
                "Message's stream's class has no default clock class: "
                "%![msg-]+n, %![sc-]+S",
                message, packet_msg->packet->stream->class);
@@ -330,8 +331,8 @@ const struct bt_clock_snapshot *
 bt_message_packet_beginning_borrow_default_clock_snapshot_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
        return borrow_packet_message_default_clock_snapshot_const(msg);
 }
 
@@ -339,8 +340,8 @@ const struct bt_clock_snapshot *
 bt_message_packet_end_borrow_default_clock_snapshot_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
        return borrow_packet_message_default_clock_snapshot_const(msg);
 }
 
@@ -359,8 +360,8 @@ const struct bt_clock_class *
 bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
        return borrow_packet_message_stream_class_default_clock_class(msg);
 }
 
@@ -368,7 +369,7 @@ const struct bt_clock_class *
 bt_message_packet_end_borrow_stream_class_default_clock_class_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
        return borrow_packet_message_stream_class_default_clock_class(msg);
 }
index fb596bb17f9887addc3104c443b16ea7283e572d..0cb1bff7280d0a04cc66a7fcf1e857dc88ce8441 100644 (file)
@@ -138,16 +138,18 @@ struct bt_stream *borrow_stream_message_stream(struct bt_message *message)
 struct bt_stream *bt_message_stream_beginning_borrow_stream(
                struct bt_message *message)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING);
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message,
+               BT_MESSAGE_TYPE_STREAM_BEGINNING);
        return borrow_stream_message_stream(message);
 }
 
 struct bt_stream *bt_message_stream_end_borrow_stream(
                struct bt_message *message)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END);
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message,
+               BT_MESSAGE_TYPE_STREAM_END);
        return borrow_stream_message_stream(message);
 }
 
@@ -173,7 +175,7 @@ void bt_message_stream_set_default_clock_snapshot(
        struct bt_stream_class *sc;
 
        BT_ASSERT(msg);
-       BT_ASSERT_PRE_HOT(msg, "Message", ": %!+n", msg);
+       BT_ASSERT_PRE_DEV_HOT(msg, "Message", ": %!+n", msg);
        sc = stream_msg->stream->class;
        BT_ASSERT(sc);
        BT_ASSERT_PRE(sc->default_clock_class,
@@ -214,7 +216,7 @@ bt_message_stream_borrow_default_clock_snapshot_const(
        BT_ASSERT(msg);
        sc = stream_msg->stream->class;
        BT_ASSERT(sc);
-       BT_ASSERT_PRE(sc->default_clock_class,
+       BT_ASSERT_PRE_DEV(sc->default_clock_class,
                "Message's stream's class has no default clock class: "
                "%![msg-]+n, %![sc-]+S", msg, sc);
        BT_ASSERT(stream_msg->default_cs);
@@ -228,9 +230,9 @@ enum bt_message_stream_clock_snapshot_state
 bt_message_stream_beginning_borrow_default_clock_snapshot_const(
                const bt_message *message, const bt_clock_snapshot **snapshot)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_BEGINNING);
-
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message,
+               BT_MESSAGE_TYPE_STREAM_BEGINNING);
        return bt_message_stream_borrow_default_clock_snapshot_const(
                message, snapshot);
 }
@@ -239,9 +241,8 @@ enum bt_message_stream_clock_snapshot_state
 bt_message_stream_end_borrow_default_clock_snapshot_const(
                const bt_message *message, const bt_clock_snapshot **snapshot)
 {
-       BT_ASSERT_PRE_NON_NULL(message, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END);
-
+       BT_ASSERT_PRE_DEV_NON_NULL(message, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(message, BT_MESSAGE_TYPE_STREAM_END);
        return bt_message_stream_borrow_default_clock_snapshot_const(
                message, snapshot);
 }
@@ -261,8 +262,8 @@ const struct bt_clock_class *
 bt_message_stream_beginning_borrow_stream_class_default_clock_class_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg,
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg,
                BT_MESSAGE_TYPE_STREAM_BEGINNING);
        return borrow_stream_message_stream_class_default_clock_class(msg);
 }
@@ -271,7 +272,7 @@ const struct bt_clock_class *
 bt_message_stream_end_borrow_stream_class_default_clock_class_const(
                const struct bt_message *msg)
 {
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END);
        return borrow_stream_message_stream_class_default_clock_class(msg);
 }
index d7455dca82afb1c6ce33185d04a277e9cc982c18..7ca86abe5703a8754276721c378b1a3bbb099349 100644 (file)
@@ -93,34 +93,34 @@ end:
 
 const char *bt_port_get_name(const struct bt_port *port)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
+       BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
        return port->name->str;
 }
 
 enum bt_port_type bt_port_get_type(const struct bt_port *port)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
+       BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
        return port->type;
 }
 
 const struct bt_connection *bt_port_borrow_connection_const(
                const struct bt_port *port)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
+       BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
        return port->connection;
 }
 
 const struct bt_component *bt_port_borrow_component_const(
                const struct bt_port *port)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
+       BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
        return bt_port_borrow_component_inline(port);
 }
 
 struct bt_self_component *bt_self_component_port_borrow_component(
                struct bt_self_component_port *port)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
+       BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
        return (void *) bt_object_borrow_parent((void *) port);
 }
 
@@ -140,13 +140,13 @@ void bt_port_set_connection(struct bt_port *port,
 
 bt_bool bt_port_is_connected(const struct bt_port *port)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
+       BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
        return port->connection ? BT_TRUE : BT_FALSE;
 }
 
 void *bt_self_component_port_get_data(const struct bt_self_component_port *port)
 {
-       BT_ASSERT_PRE_NON_NULL(port, "Port");
+       BT_ASSERT_PRE_DEV_NON_NULL(port, "Port");
        return ((struct bt_port *) port)->user_data;
 }
 
index 5e13d52560e41f242016740272be0f1577462fbb..e381917e3ceb7fae0850246dac9136192b3da705 100644 (file)
@@ -162,7 +162,7 @@ enum bt_query_executor_cancel_status bt_query_executor_cancel(
 
 bt_bool bt_query_executor_is_canceled(const struct bt_query_executor *query_exec)
 {
-       BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
+       BT_ASSERT_PRE_DEV_NON_NULL(query_exec, "Query executor");
        return query_exec->canceled;
 }
 
index 2d9fc602833e66a61f0fc3158466bf08e40bfea0..75c13e1571e00e96d6056ca870329518f3d8aabc 100644 (file)
@@ -345,8 +345,8 @@ void bt_object_get_ref(const void *ptr)
                return;
        }
 
-#ifdef BT_ASSERT_PRE
-       BT_ASSERT_PRE(obj->is_shared, "Object is not shared: %!+O", obj);
+#ifdef BT_ASSERT_PRE_DEV
+       BT_ASSERT_PRE_DEV(obj->is_shared, "Object is not shared: %!+O", obj);
 #endif
 
        bt_object_get_no_null_check(obj);
@@ -361,9 +361,9 @@ void bt_object_put_ref(const void *ptr)
                return;
        }
 
-#ifdef BT_ASSERT_PRE
-       BT_ASSERT_PRE(obj->is_shared, "Object is not shared: %!+O", obj);
-       BT_ASSERT_PRE(bt_object_get_ref_count(obj) > 0,
+#ifdef BT_ASSERT_PRE_DEV
+       BT_ASSERT_PRE_DEV(obj->is_shared, "Object is not shared: %!+O", obj);
+       BT_ASSERT_PRE_DEV(bt_object_get_ref_count(obj) > 0,
                "Decrementing a reference count set to 0: %!+O", ptr);
 #endif
 
index 74b3eb51d3b1fd1a9d68de5f5d834fc8ed03f5f8..06dd96837ead16a71055a5b8a3e84ec3afec11f5 100644 (file)
@@ -145,15 +145,15 @@ void fini_python_plugin_provider(void) {
 
 uint64_t bt_plugin_set_get_plugin_count(struct bt_plugin_set *plugin_set)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin_set, "Plugin set");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin_set, "Plugin set");
        return (uint64_t) plugin_set->plugins->len;
 }
 
 const struct bt_plugin *bt_plugin_set_borrow_plugin_by_index_const(
                const struct bt_plugin_set *plugin_set, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin_set, "Plugin set");
-       BT_ASSERT_PRE_VALID_INDEX(index, plugin_set->plugins->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin_set, "Plugin set");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, plugin_set->plugins->len);
        return g_ptr_array_index(plugin_set->plugins, index);
 }
 
@@ -626,31 +626,31 @@ end:
 
 const char *bt_plugin_get_name(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
        return plugin->info.name_set ? plugin->info.name->str : NULL;
 }
 
 const char *bt_plugin_get_author(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
        return plugin->info.author_set ? plugin->info.author->str : NULL;
 }
 
 const char *bt_plugin_get_license(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
        return plugin->info.license_set ? plugin->info.license->str : NULL;
 }
 
 const char *bt_plugin_get_path(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
        return plugin->info.path_set ? plugin->info.path->str : NULL;
 }
 
 const char *bt_plugin_get_description(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
        return plugin->info.description_set ?
                plugin->info.description->str : NULL;
 }
@@ -662,7 +662,7 @@ enum bt_property_availability bt_plugin_get_version(const struct bt_plugin *plug
        enum bt_property_availability avail =
                BT_PROPERTY_AVAILABILITY_AVAILABLE;
 
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
 
        if (!plugin->info.version_set) {
                BT_LIB_LOGD("Plugin's version is not set: %!+l", plugin);
@@ -692,19 +692,19 @@ end:
 
 uint64_t bt_plugin_get_source_component_class_count(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
        return (uint64_t) plugin->src_comp_classes->len;
 }
 
 uint64_t bt_plugin_get_filter_component_class_count(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
        return (uint64_t) plugin->flt_comp_classes->len;
 }
 
 uint64_t bt_plugin_get_sink_component_class_count(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
        return (uint64_t) plugin->sink_comp_classes->len;
 }
 
@@ -713,8 +713,8 @@ struct bt_component_class *borrow_component_class_by_index(
                const struct bt_plugin *plugin, GPtrArray *comp_classes,
                uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
-       BT_ASSERT_PRE_VALID_INDEX(index, comp_classes->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp_classes->len);
        return g_ptr_array_index(comp_classes, index);
 }
 
@@ -750,8 +750,8 @@ struct bt_component_class *borrow_component_class_by_name(
        struct bt_component_class *comp_class = NULL;
        size_t i;
 
-       BT_ASSERT_PRE_NON_NULL(plugin, "Plugin");
-       BT_ASSERT_PRE_NON_NULL(name, "Name");
+       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
 
        for (i = 0; i < comp_classes->len; i++) {
                struct bt_component_class *comp_class_candidate =
index 119b4db929e887a3877c5b54f0489b0b6d32311f..065cf97665bc5b61fc6a2d95461dcf9d01d5116c 100644 (file)
@@ -39,8 +39,8 @@
 #include "common/assert.h"
 #include "lib/func-status.h"
 
-#define BT_ASSERT_PRE_CLOCK_CLASS_HOT(_cc) \
-       BT_ASSERT_PRE_HOT((_cc), "Clock class", ": %!+K", (_cc))
+#define BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(_cc) \
+       BT_ASSERT_PRE_DEV_HOT((_cc), "Clock class", ": %!+K", (_cc))
 
 static
 void destroy_clock_class(struct bt_object *obj)
@@ -134,7 +134,7 @@ end:
 
 const char *bt_clock_class_get_name(const struct bt_clock_class *clock_class)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
        return clock_class->name.value;
 }
 
@@ -143,7 +143,7 @@ enum bt_clock_class_set_name_status bt_clock_class_set_name(
 {
        BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
-       BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
+       BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
        g_string_assign(clock_class->name.str, name);
        clock_class->name.value = clock_class->name.str->str;
        BT_LIB_LOGD("Set clock class's name: %!+K", clock_class);
@@ -153,7 +153,7 @@ enum bt_clock_class_set_name_status bt_clock_class_set_name(
 const char *bt_clock_class_get_description(
                const struct bt_clock_class *clock_class)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
        return clock_class->description.value;
 }
 
@@ -162,7 +162,7 @@ enum bt_clock_class_set_description_status bt_clock_class_set_description(
 {
        BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
        BT_ASSERT_PRE_NON_NULL(descr, "Description");
-       BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
+       BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
        g_string_assign(clock_class->description.str, descr);
        clock_class->description.value = clock_class->description.str->str;
        BT_LIB_LOGD("Set clock class's description: %!+K",
@@ -172,7 +172,7 @@ enum bt_clock_class_set_description_status bt_clock_class_set_description(
 
 uint64_t bt_clock_class_get_frequency(const struct bt_clock_class *clock_class)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
        return clock_class->frequency;
 }
 
@@ -180,7 +180,7 @@ void bt_clock_class_set_frequency(struct bt_clock_class *clock_class,
                uint64_t frequency)
 {
        BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
-       BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
+       BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
        BT_ASSERT_PRE(frequency != UINT64_C(-1) && frequency != 0,
                "Invalid frequency: %![cc-]+K, new-freq=%" PRIu64,
                clock_class, frequency);
@@ -194,7 +194,7 @@ void bt_clock_class_set_frequency(struct bt_clock_class *clock_class,
 
 uint64_t bt_clock_class_get_precision(const struct bt_clock_class *clock_class)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
        return clock_class->precision;
 }
 
@@ -202,7 +202,7 @@ void bt_clock_class_set_precision(struct bt_clock_class *clock_class,
                uint64_t precision)
 {
        BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
-       BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
+       BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
        BT_ASSERT_PRE(precision != UINT64_C(-1),
                "Invalid precision: %![cc-]+K, new-precision=%" PRIu64,
                clock_class, precision);
@@ -213,9 +213,9 @@ void bt_clock_class_set_precision(struct bt_clock_class *clock_class,
 void bt_clock_class_get_offset(const struct bt_clock_class *clock_class,
                int64_t *seconds, uint64_t *cycles)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
-       BT_ASSERT_PRE_NON_NULL(seconds, "Seconds (output)");
-       BT_ASSERT_PRE_NON_NULL(cycles, "Cycles (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+       BT_ASSERT_PRE_DEV_NON_NULL(seconds, "Seconds (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(cycles, "Cycles (output)");
        *seconds = clock_class->offset_seconds;
        *cycles = clock_class->offset_cycles;
 }
@@ -224,7 +224,7 @@ void bt_clock_class_set_offset(struct bt_clock_class *clock_class,
                int64_t seconds, uint64_t cycles)
 {
        BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
-       BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
+       BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
        BT_ASSERT_PRE(cycles < clock_class->frequency,
                "Offset (cycles) is greater than clock class's frequency: "
                "%![cc-]+K, new-offset-cycles=%" PRIu64, clock_class, cycles);
@@ -236,7 +236,7 @@ void bt_clock_class_set_offset(struct bt_clock_class *clock_class,
 
 bt_bool bt_clock_class_origin_is_unix_epoch(const struct bt_clock_class *clock_class)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
        return (bool) clock_class->origin_is_unix_epoch;
 }
 
@@ -244,7 +244,7 @@ void bt_clock_class_set_origin_is_unix_epoch(struct bt_clock_class *clock_class,
                bt_bool origin_is_unix_epoch)
 {
        BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
-       BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
+       BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
        clock_class->origin_is_unix_epoch = (bool) origin_is_unix_epoch;
        BT_LIB_LOGD("Set clock class's origin is Unix epoch property: %!+K",
                clock_class);
@@ -252,7 +252,7 @@ void bt_clock_class_set_origin_is_unix_epoch(struct bt_clock_class *clock_class,
 
 bt_uuid bt_clock_class_get_uuid(const struct bt_clock_class *clock_class)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
        return clock_class->uuid.value;
 }
 
@@ -261,7 +261,7 @@ void bt_clock_class_set_uuid(struct bt_clock_class *clock_class,
 {
        BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
        BT_ASSERT_PRE_NON_NULL(uuid, "UUID");
-       BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
+       BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
        bt_uuid_copy(clock_class->uuid.uuid, uuid);
        clock_class->uuid.value = clock_class->uuid.uuid;
        BT_LIB_LOGD("Set clock class's UUID: %!+K", clock_class);
@@ -287,8 +287,8 @@ bt_clock_class_cycles_to_ns_from_origin(
 {
        int ret;
 
-       BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
-       BT_ASSERT_PRE_NON_NULL(ns, "Nanoseconds (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
+       BT_ASSERT_PRE_DEV_NON_NULL(ns, "Nanoseconds (output)");
        ret = bt_util_ns_from_origin_clock_class(clock_class, cycles, ns);
        if (ret) {
                ret = BT_FUNC_STATUS_OVERFLOW;
index 19e6781673efbeff125c3ff33082118656eb920d..fef9f670873e47d8ca9510b5f690e30bef8cb3f1 100644 (file)
@@ -144,8 +144,8 @@ void bt_clock_snapshot_recycle(struct bt_clock_snapshot *clock_snapshot)
 uint64_t bt_clock_snapshot_get_value(
                const struct bt_clock_snapshot *clock_snapshot)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_snapshot, "Clock snapshot");
-       BT_ASSERT_PRE(clock_snapshot->is_set,
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
+       BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
                "Clock snapshot is not set: %!+k", clock_snapshot);
        return clock_snapshot->value_cycles;
 }
@@ -157,9 +157,9 @@ bt_clock_snapshot_get_ns_from_origin(
 {
        int ret = BT_FUNC_STATUS_OK;
 
-       BT_ASSERT_PRE_NON_NULL(clock_snapshot, "Clock snapshot");
-       BT_ASSERT_PRE_NON_NULL(ret_value_ns, "Value (ns) (output)");
-       BT_ASSERT_PRE(clock_snapshot->is_set,
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
+       BT_ASSERT_PRE_DEV_NON_NULL(ret_value_ns, "Value (ns) (output)");
+       BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
                "Clock snapshot is not set: %!+k", clock_snapshot);
 
        if (clock_snapshot->ns_from_origin_overflows) {
@@ -179,6 +179,6 @@ end:
 const struct bt_clock_class *bt_clock_snapshot_borrow_clock_class_const(
                const struct bt_clock_snapshot *clock_snapshot)
 {
-       BT_ASSERT_PRE_NON_NULL(clock_snapshot, "Clock snapshot");
+       BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
        return clock_snapshot->clock_class;
 }
index 5bc572f2516dbbaafa6f20aa844973a64f1b7e89..efbd676654cdfaa8e6cca8afb329e5fc3f9b8b44 100644 (file)
@@ -49,8 +49,8 @@
 #include "utils.h"
 #include "lib/func-status.h"
 
-#define BT_ASSERT_PRE_EVENT_CLASS_HOT(_ec) \
-       BT_ASSERT_PRE_HOT(((const struct bt_event_class *) (_ec)),      \
+#define BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(_ec) \
+       BT_ASSERT_PRE_DEV_HOT(((const struct bt_event_class *) (_ec)),  \
                "Event class", ": %!+E", (_ec))
 
 static
@@ -191,7 +191,7 @@ struct bt_event_class *bt_event_class_create_with_id(
 
 const char *bt_event_class_get_name(const struct bt_event_class *event_class)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
        return event_class->name.value;
 }
 
@@ -200,7 +200,7 @@ enum bt_event_class_set_name_status bt_event_class_set_name(
 {
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
-       BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
+       BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
        g_string_assign(event_class->name.str, name);
        event_class->name.value = event_class->name.str->str;
        BT_LIB_LOGD("Set event class's name: %!+E", event_class);
@@ -209,7 +209,7 @@ enum bt_event_class_set_name_status bt_event_class_set_name(
 
 uint64_t bt_event_class_get_id(const struct bt_event_class *event_class)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
        return event_class->id;
 }
 
@@ -217,8 +217,8 @@ enum bt_property_availability bt_event_class_get_log_level(
                const struct bt_event_class *event_class,
                enum bt_event_class_log_level *log_level)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
-       BT_ASSERT_PRE_NON_NULL(log_level, "Log level (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(log_level, "Log level (output)");
        *log_level = (enum bt_event_class_log_level)
                event_class->log_level.value;
        return event_class->log_level.base.avail;
@@ -229,7 +229,7 @@ void bt_event_class_set_log_level(
                enum bt_event_class_log_level log_level)
 {
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
-       BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
+       BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
        bt_property_uint_set(&event_class->log_level,
                (uint64_t) log_level);
        BT_LIB_LOGD("Set event class's log level: %!+E", event_class);
@@ -237,7 +237,7 @@ void bt_event_class_set_log_level(
 
 const char *bt_event_class_get_emf_uri(const struct bt_event_class *event_class)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
        return event_class->emf_uri.value;
 }
 
@@ -247,7 +247,7 @@ enum bt_event_class_set_emf_uri_status bt_event_class_set_emf_uri(
 {
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
        BT_ASSERT_PRE_NON_NULL(emf_uri, "EMF URI");
-       BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
+       BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
        g_string_assign(event_class->emf_uri.str, emf_uri);
        event_class->emf_uri.value = event_class->emf_uri.str->str;
        BT_LIB_LOGD("Set event class's EMF URI: %!+E", event_class);
@@ -257,7 +257,7 @@ enum bt_event_class_set_emf_uri_status bt_event_class_set_emf_uri(
 struct bt_stream_class *bt_event_class_borrow_stream_class(
                struct bt_event_class *event_class)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
        return bt_event_class_borrow_stream_class_inline(event_class);
 }
 
@@ -272,7 +272,7 @@ const struct bt_field_class *
 bt_event_class_borrow_specific_context_field_class_const(
                const struct bt_event_class *event_class)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
        return event_class->specific_context_fc;
 }
 
@@ -280,7 +280,7 @@ struct bt_field_class *
 bt_event_class_borrow_specific_context_field_class(
                struct bt_event_class *event_class)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
        return event_class->specific_context_fc;
 }
 
@@ -300,7 +300,7 @@ bt_event_class_set_specific_context_field_class(
 
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
-       BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
+       BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
        BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
                BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Specific context field class is not a structure field class: "
@@ -337,14 +337,14 @@ end:
 const struct bt_field_class *bt_event_class_borrow_payload_field_class_const(
                const struct bt_event_class *event_class)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
        return event_class->payload_fc;
 }
 
 struct bt_field_class *bt_event_class_borrow_payload_field_class(
                struct bt_event_class *event_class)
 {
-       BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
+       BT_ASSERT_PRE_DEV_NON_NULL(event_class, "Event class");
        return event_class->payload_fc;
 }
 
@@ -364,7 +364,7 @@ bt_event_class_set_payload_field_class(
 
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
-       BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
+       BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
        BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
                BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Payload field class is not a structure field class: %!+F",
index 15b40c8c3fb27d4e1ea4a52fc8c6589dfc8c2895..fe1489bb0a64d42d5d6f787de83fdd236c599714 100644 (file)
@@ -137,7 +137,7 @@ end:
 
 struct bt_event_class *bt_event_borrow_class(struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->class;
 }
 
@@ -149,7 +149,7 @@ const struct bt_event_class *bt_event_borrow_class_const(
 
 struct bt_stream *bt_event_borrow_stream(struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->stream;
 }
 
@@ -161,40 +161,40 @@ const struct bt_stream *bt_event_borrow_stream_const(
 
 struct bt_field *bt_event_borrow_common_context_field(struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->common_context_field;
 }
 
 const struct bt_field *bt_event_borrow_common_context_field_const(
                const struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->common_context_field;
 }
 
 struct bt_field *bt_event_borrow_specific_context_field(struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->specific_context_field;
 }
 
 const struct bt_field *bt_event_borrow_specific_context_field_const(
                const struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->specific_context_field;
 }
 
 struct bt_field *bt_event_borrow_payload_field(struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->payload_field;
 }
 
 const struct bt_field *bt_event_borrow_payload_field_const(
                const struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->payload_field;
 }
 
@@ -233,7 +233,7 @@ void bt_event_destroy(struct bt_event *event)
 
 struct bt_packet *bt_event_borrow_packet(struct bt_event *event)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
        return event->packet;
 }
 
index 71318f95b626b3b8e11b8db83f3e603d2f00d9f9..fff20d762c0bb7a6f1820bc33b52b98b3379e4be 100644 (file)
@@ -46,8 +46,8 @@
 #include "packet.h"
 #include "stream.h"
 
-#define BT_ASSERT_PRE_EVENT_HOT(_event) \
-       BT_ASSERT_PRE_HOT(((const struct bt_event *) (_event)),         \
+#define BT_ASSERT_PRE_DEV_EVENT_HOT(_event)                            \
+       BT_ASSERT_PRE_DEV_HOT(((const struct bt_event *) (_event)),     \
                "Event", ": %!+e", (_event))
 
 struct bt_event {
@@ -171,10 +171,10 @@ void bt_event_recycle(struct bt_event *event)
 static inline
 void bt_event_set_packet(struct bt_event *event, struct bt_packet *packet)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
-       BT_ASSERT_PRE_NON_NULL(packet, "Packet");
-       BT_ASSERT_PRE_EVENT_HOT(event);
-       BT_ASSERT_PRE(bt_event_class_borrow_stream_class(
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet");
+       BT_ASSERT_PRE_DEV_EVENT_HOT(event);
+       BT_ASSERT_PRE_DEV(bt_event_class_borrow_stream_class(
                event->class) == packet->stream->class,
                "Packet's stream class and event's stream class differ: "
                "%![event-]+e, %![packet-]+a", event, packet);
@@ -189,10 +189,10 @@ void bt_event_set_packet(struct bt_event *event, struct bt_packet *packet)
 static inline
 void bt_event_set_stream(struct bt_event *event, struct bt_stream *stream)
 {
-       BT_ASSERT_PRE_NON_NULL(event, "Event");
-       BT_ASSERT_PRE_NON_NULL(stream, "Stream");
-       BT_ASSERT_PRE_EVENT_HOT(event);
-       BT_ASSERT_PRE(bt_event_class_borrow_stream_class(
+       BT_ASSERT_PRE_DEV_NON_NULL(event, "Event");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
+       BT_ASSERT_PRE_DEV_EVENT_HOT(event);
+       BT_ASSERT_PRE_DEV(bt_event_class_borrow_stream_class(
                event->class) == stream->class,
                "Stream's class and event's stream class differ: "
                "%![event-]+e, %![stream-]+s", event, stream);
index c413f7e511232d81138fb7cfa1303516f503e739..30f85dbf4ed8adf8c80e8eef12a1895c6d20ae56 100644 (file)
@@ -49,7 +49,7 @@
 enum bt_field_class_type bt_field_class_get_type(
                const struct bt_field_class *fc)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
        return fc->type;
 }
 
@@ -128,8 +128,8 @@ uint64_t bt_field_class_integer_get_field_value_range(
 {
        const struct bt_field_class_integer *int_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
        return int_fc->range;
 }
 
@@ -149,7 +149,7 @@ void bt_field_class_integer_set_field_value_range(
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        BT_ASSERT_PRE(size <= 64,
                "Unsupported size for integer field class's field value range "
                "(maximum is 64): size=%" PRIu64, size);
@@ -169,8 +169,8 @@ bt_field_class_integer_get_preferred_display_base(const struct bt_field_class *f
 {
        const struct bt_field_class_integer *int_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_INT(fc, "Field class");
        return int_fc->base;
 }
 
@@ -182,7 +182,7 @@ void bt_field_class_integer_set_preferred_display_base(
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        int_fc->base = base;
        BT_LIB_LOGD("Set integer field class's preferred display base: %!+F", fc);
 }
@@ -290,8 +290,8 @@ uint64_t bt_field_class_enumeration_get_mapping_count(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ENUM(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ENUM(fc, "Field class");
        return (uint64_t) enum_fc->mappings->len;
 }
 
@@ -301,9 +301,9 @@ bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_VALID_INDEX(index, enum_fc->mappings->len);
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
 }
@@ -314,9 +314,9 @@ bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
 {
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_VALID_INDEX(index, enum_fc->mappings->len);
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, enum_fc->mappings->len);
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index);
 }
@@ -324,14 +324,14 @@ bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
 const char *bt_field_class_enumeration_mapping_get_label(
                const struct bt_field_class_enumeration_mapping *mapping)
 {
-       BT_ASSERT_PRE_NON_NULL(mapping, "Enumeration field class mapping");
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Enumeration field class mapping");
        return mapping->label->str;
 }
 
 uint64_t bt_field_class_enumeration_mapping_get_range_count(
                const struct bt_field_class_enumeration_mapping *mapping)
 {
-       BT_ASSERT_PRE_NON_NULL(mapping, "Enumeration field class mapping");
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Enumeration field class mapping");
        return (uint64_t) mapping->ranges->len;
 }
 
@@ -342,10 +342,10 @@ void get_enumeration_field_class_mapping_range_at_index(
 {
        const struct bt_field_class_enumeration_mapping_range *range;
 
-       BT_ASSERT_PRE_NON_NULL(mapping, "Ranges");
-       BT_ASSERT_PRE_NON_NULL(lower, "Range's lower (output)");
-       BT_ASSERT_PRE_NON_NULL(upper, "Range's upper (output)");
-       BT_ASSERT_PRE_VALID_INDEX(index, mapping->ranges->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(mapping, "Ranges");
+       BT_ASSERT_PRE_DEV_NON_NULL(lower, "Range's lower (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(upper, "Range's upper (output)");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, mapping->ranges->len);
        range = BT_FIELD_CLASS_ENUM_MAPPING_RANGE_AT_INDEX(mapping, index);
        *lower = range->lower.u;
        *upper = range->upper.u;
@@ -377,10 +377,10 @@ bt_field_class_unsigned_enumeration_get_mapping_labels_for_value(
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
                "Field class");
        g_ptr_array_set_size(enum_fc->label_buf, 0);
 
@@ -417,10 +417,10 @@ bt_field_class_signed_enumeration_get_mapping_labels_for_value(
        const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(count, "Count (output)");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
                "Field class");
        g_ptr_array_set_size(enum_fc->label_buf, 0);
 
@@ -514,7 +514,8 @@ end:
        return ret;
 }
 
-enum bt_field_class_enumeration_map_range_status bt_field_class_unsigned_enumeration_map_range(
+enum bt_field_class_enumeration_map_range_status
+bt_field_class_unsigned_enumeration_map_range(
                struct bt_field_class *fc, const char *label,
                uint64_t range_lower, uint64_t range_upper)
 {
@@ -539,7 +540,8 @@ enum bt_field_class_enumeration_map_range_status bt_field_class_unsigned_enumera
                range_upper);
 }
 
-enum bt_field_class_enumeration_map_range_status bt_field_class_signed_enumeration_map_range(
+enum bt_field_class_enumeration_map_range_status
+bt_field_class_signed_enumeration_map_range(
                struct bt_field_class *fc, const char *label,
                int64_t range_lower, int64_t range_upper)
 {
@@ -600,8 +602,8 @@ bt_bool bt_field_class_real_is_single_precision(const struct bt_field_class *fc)
 {
        const struct bt_field_class_real *real_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
        return real_fc->is_single_precision;
 }
 
@@ -612,7 +614,7 @@ void bt_field_class_real_set_is_single_precision(struct bt_field_class *fc,
 
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Field class");
        real_fc->is_single_precision = (bool) is_single_precision;
        BT_LIB_LOGD("Set real field class's \"is single precision\" property: "
                "%!+F", fc);
@@ -736,7 +738,7 @@ int append_named_field_class_to_container_field_class(
        GString *name_str;
 
        BT_ASSERT(container_fc);
-       BT_ASSERT_PRE_FC_HOT(container_fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(container_fc, "Field class");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
        BT_ASSERT_PRE_NON_NULL(fc, "Field class");
        BT_ASSERT_PRE(!bt_g_hash_table_contains(container_fc->name_to_index,
@@ -789,8 +791,8 @@ uint64_t bt_field_class_structure_get_member_count(
 {
        struct bt_field_class_structure *struct_fc = (void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (uint64_t) struct_fc->common.named_fcs->len;
 }
@@ -802,7 +804,7 @@ borrow_named_field_class_from_container_field_class_at_index(
                uint64_t index)
 {
        BT_ASSERT(fc);
-       BT_ASSERT_PRE_VALID_INDEX(index, fc->named_fcs->len);
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, fc->named_fcs->len);
        return BT_FIELD_CLASS_NAMED_FC_AT_INDEX(fc, index);
 }
 
@@ -810,8 +812,8 @@ const struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_index_const(
                const struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_at_index(
@@ -822,8 +824,8 @@ struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_index(
                struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_at_index(
@@ -841,7 +843,7 @@ borrow_named_field_class_from_container_field_class_by_name(
        gpointer value;
 
        BT_ASSERT(fc);
-       BT_ASSERT_PRE_NON_NULL(name, "Name");
+       BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
        if (!g_hash_table_lookup_extended(fc->name_to_index, name, &orig_key,
                        &value)) {
                goto end;
@@ -858,8 +860,8 @@ const struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_name_const(
                const struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_by_name(
@@ -870,8 +872,8 @@ struct bt_field_class_structure_member *
 bt_field_class_structure_borrow_member_by_name(
                struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_by_name(
@@ -883,7 +885,7 @@ const char *bt_field_class_structure_member_get_name(
 {
        const struct bt_named_field_class *named_fc = (const void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->name->str;
 }
 
@@ -893,7 +895,7 @@ bt_field_class_structure_member_borrow_field_class_const(
 {
        const struct bt_named_field_class *named_fc = (const void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->fc;
 }
 
@@ -903,7 +905,7 @@ bt_field_class_structure_member_borrow_field_class(
 {
        struct bt_named_field_class *named_fc = (void *) member;
 
-       BT_ASSERT_PRE_NON_NULL(member, "Structure field class member");
+       BT_ASSERT_PRE_DEV_NON_NULL(member, "Structure field class member");
        return named_fc->fc;
 }
 
@@ -964,7 +966,7 @@ bt_field_class_variant_set_selector_field_class(
        BT_ASSERT_PRE_NON_NULL(selector_fc, "Selector field class");
        BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        BT_ASSERT_PRE_FC_IS_ENUM(selector_fc, "Selector field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Variant field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Variant field class");
        var_fc->selector_fc = selector_fc;
        bt_object_get_no_null_check(selector_fc);
        bt_field_class_freeze(selector_fc);
@@ -987,8 +989,9 @@ const struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_name_const(
                const struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
+               "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_by_name(
                        (void *) fc, name);
@@ -998,8 +1001,8 @@ struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_name(
                struct bt_field_class *fc, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_by_name(
                        (void *) fc, name);
@@ -1009,8 +1012,8 @@ uint64_t bt_field_class_variant_get_option_count(const struct bt_field_class *fc
 {
        const struct bt_field_class_variant *var_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (uint64_t) var_fc->common.named_fcs->len;
 }
 
@@ -1018,8 +1021,8 @@ const struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_index_const(
                const struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (const void *)
                borrow_named_field_class_from_container_field_class_at_index(
                        (void *) fc, index);
@@ -1029,8 +1032,8 @@ struct bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_index(
                struct bt_field_class *fc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
        return (void *)
                borrow_named_field_class_from_container_field_class_at_index(
                        (void *) fc, index);
@@ -1041,7 +1044,7 @@ const char *bt_field_class_variant_option_get_name(
 {
        const struct bt_named_field_class *named_fc = (const void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->name->str;
 }
 
@@ -1051,7 +1054,7 @@ bt_field_class_variant_option_borrow_field_class_const(
 {
        const struct bt_named_field_class *named_fc = (const void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->fc;
 }
 
@@ -1061,7 +1064,7 @@ bt_field_class_variant_option_borrow_field_class(
 {
        struct bt_named_field_class *named_fc = (void *) option;
 
-       BT_ASSERT_PRE_NON_NULL(option, "Variant field class option");
+       BT_ASSERT_PRE_DEV_NON_NULL(option, "Variant field class option");
        return named_fc->fc;
 }
 
@@ -1071,8 +1074,8 @@ bt_field_class_variant_borrow_selector_field_path_const(
 {
        const struct bt_field_class_variant *var_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT,
                "Field class");
        return var_fc->selector_field_path;
 }
@@ -1141,8 +1144,8 @@ bt_field_class_array_borrow_element_field_class_const(
 {
        const struct bt_field_class_array *array_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ARRAY(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
        return array_fc->element_fc;
 }
 
@@ -1151,8 +1154,8 @@ bt_field_class_array_borrow_element_field_class(struct bt_field_class *fc)
 {
        struct bt_field_class_array *array_fc = (void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_IS_ARRAY(fc, "Field class");
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_IS_ARRAY(fc, "Field class");
        return array_fc->element_fc;
 }
 
@@ -1160,8 +1163,8 @@ uint64_t bt_field_class_static_array_get_length(const struct bt_field_class *fc)
 {
        const struct bt_field_class_static_array *array_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
                "Field class");
        return (uint64_t) array_fc->length;
 }
@@ -1222,7 +1225,7 @@ bt_field_class_dynamic_array_set_length_field_class(
        BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
                "Field class");
        BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(length_fc, "Length field class");
-       BT_ASSERT_PRE_FC_HOT(fc, "Dynamic array field class");
+       BT_ASSERT_PRE_DEV_FC_HOT(fc, "Dynamic array field class");
        array_fc->length_fc = length_fc;
        bt_object_get_no_null_check(length_fc);
        bt_field_class_freeze(length_fc);
@@ -1235,8 +1238,8 @@ bt_field_class_dynamic_array_borrow_length_field_path_const(
 {
        const struct bt_field_class_dynamic_array *seq_fc = (const void *) fc;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
-       BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
+       BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
+       BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
                "Field class");
        return seq_fc->length_field_path;
 }
@@ -1318,7 +1321,7 @@ void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc)
 }
 
 BT_HIDDEN
-void _bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc)
+void bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc)
 {
        struct bt_field_class *fc = (void *) c_fc;
 
index 52582d38e2db2b77949ab1ad0ca2324d043c3984..447eaab3298cd9f59bf83ea49bd5a08079a18449 100644 (file)
 #include <stdint.h>
 #include <glib.h>
 
+#define _BT_ASSERT_PRE_FC_IS_INT_COND(_fc)                             \
+       (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
+       ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || \
+       ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION || \
+       ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION)
+
+#define _BT_ASSERT_PRE_FC_IS_INT_FMT(_name)                            \
+       _name " is not an integer field class: %![fc-]+F"
+
+#define _BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_COND(_fc)                    \
+       (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
+       ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION)
+
+#define _BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_FMT(_name)                   \
+       _name " is not an unsigned integer field class: %![fc-]+F"
+
+#define _BT_ASSERT_PRE_FC_IS_ENUM_COND(_fc)                            \
+       (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION || \
+       ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION)
+
+#define _BT_ASSERT_PRE_FC_IS_ENUM_FMT(_name)                           \
+       _name " is not an enumeration field class: %![fc-]+F"
+
+#define _BT_ASSERT_PRE_FC_IS_ARRAY_COND(_fc)                           \
+       (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
+       ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY)
+
+#define _BT_ASSERT_PRE_FC_IS_ARRAY_FMT(_name)                          \
+       _name " is not an array field class: %![fc-]+F"
+
+#define _BT_ASSERT_PRE_FC_HAS_ID_COND(_fc, _type)                      \
+       (((const struct bt_field_class *) (_fc))->type == (_type))
+
+#define _BT_ASSERT_PRE_FC_HAS_ID_FMT(_name)                            \
+       _name " has the wrong type: expected-type=%s, %![fc-]+F"
+
 #define BT_ASSERT_PRE_FC_IS_INT(_fc, _name)                            \
-       BT_ASSERT_PRE(                                                  \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION || \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, \
-               _name " is not an integer field class: %![fc-]+F", (_fc))
+       BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_INT_COND(_fc),               \
+       _BT_ASSERT_PRE_FC_IS_INT_FMT(_name), (_fc))
 
 #define BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(_fc, _name)                   \
-       BT_ASSERT_PRE(                                                  \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, \
-               _name " is not an unsigned integer field class: %![fc-]+F", (_fc))
+       BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_COND(_fc),      \
+       _BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_FMT(_name), (_fc))
 
 #define BT_ASSERT_PRE_FC_IS_ENUM(_fc, _name)                           \
-       BT_ASSERT_PRE(                                                  \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION || \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, \
-               _name " is not an enumeration field class: %![fc-]+F", (_fc))
+       BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_ENUM_COND(_fc),              \
+       _BT_ASSERT_PRE_FC_IS_ENUM_FMT(_name), (_fc))
 
 #define BT_ASSERT_PRE_FC_IS_ARRAY(_fc, _name)                          \
-       BT_ASSERT_PRE(                                                  \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
-               ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, \
-               _name " is not an array field class: %![fc-]+F", (_fc))
+       BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_IS_ARRAY_COND(_fc),             \
+       _BT_ASSERT_PRE_FC_IS_ARRAY_FMT(_name), (_fc))
 
 #define BT_ASSERT_PRE_FC_HAS_ID(_fc, _type, _name)                     \
-       BT_ASSERT_PRE(((const struct bt_field_class *) (_fc))->type == (_type),         \
-               _name " has the wrong type: expected-type=%s, "         \
-               "%![fc-]+F", bt_common_field_class_type_string(_type), (_fc))
+       BT_ASSERT_PRE(_BT_ASSERT_PRE_FC_HAS_ID_COND((_fc), (_type)),    \
+       _BT_ASSERT_PRE_FC_HAS_ID_FMT(_name),                            \
+       bt_common_field_class_type_string(_type), (_fc))
 
-#define BT_ASSERT_PRE_FC_HOT(_fc, _name)                               \
-       BT_ASSERT_PRE_HOT((const struct bt_field_class *) (_fc),                \
+#define BT_ASSERT_PRE_DEV_FC_IS_INT(_fc, _name)                                \
+       BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_INT_COND(_fc),           \
+       _BT_ASSERT_PRE_FC_IS_INT_FMT(_name), (_fc))
+
+#define BT_ASSERT_PRE_DEV_FC_IS_UNSIGNED_INT(_fc, _name)               \
+       BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_COND(_fc),  \
+       _BT_ASSERT_PRE_FC_IS_UNSIGNED_INT_FMT(_name), (_fc))
+
+#define BT_ASSERT_PRE_DEV_FC_IS_ENUM(_fc, _name)                       \
+       BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_ENUM_COND(_fc),          \
+       _BT_ASSERT_PRE_FC_IS_ENUM_FMT(_name), (_fc))
+
+#define BT_ASSERT_PRE_DEV_FC_IS_ARRAY(_fc, _name)                      \
+       BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_IS_ARRAY_COND(_fc),         \
+       _BT_ASSERT_PRE_FC_IS_ARRAY_FMT(_name), (_fc))
+
+#define BT_ASSERT_PRE_DEV_FC_HAS_ID(_fc, _type, _name)                 \
+       BT_ASSERT_PRE_DEV(_BT_ASSERT_PRE_FC_HAS_ID_COND((_fc), (_type)), \
+       _BT_ASSERT_PRE_FC_HAS_ID_FMT(_name),                            \
+       bt_common_field_class_type_string(_type), (_fc))
+
+#define BT_ASSERT_PRE_DEV_FC_HOT(_fc, _name)                           \
+       BT_ASSERT_PRE_DEV_HOT((const struct bt_field_class *) (_fc),    \
                (_name), ": %!+F", (_fc))
 
-#define BT_FIELD_CLASS_NAMED_FC_AT_INDEX(_fc, _index)          \
+#define BT_FIELD_CLASS_NAMED_FC_AT_INDEX(_fc, _index)                  \
        (&g_array_index(((struct bt_field_class_named_field_class_container *) (_fc))->named_fcs, \
                struct bt_named_field_class, (_index)))
 
@@ -89,8 +136,8 @@ struct bt_field_class {
        bool frozen;
 
        /*
-        * Only used in developer mode, this flag indicates whether or
-        * not this field class is part of a trace class.
+        * This flag indicates whether or not this field class is part
+        * of a trace class.
         */
        bool part_of_trace_class;
 };
@@ -258,13 +305,7 @@ void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc);
  * shared objects for other purposes.
  */
 BT_HIDDEN
-void _bt_field_class_make_part_of_trace_class(
+void bt_field_class_make_part_of_trace_class(
                const struct bt_field_class *field_class);
 
-#ifdef BT_DEV_MODE
-# define bt_field_class_make_part_of_trace_class       _bt_field_class_make_part_of_trace_class
-#else
-# define bt_field_class_make_part_of_trace_class(_fc)  ((void) _fc)
-#endif
-
 #endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H */
index 80c9f3181f287e20a0fbe639d72d737a7589358a..230db9dd53ecf7b15583f15878c2d1d857d0e103 100644 (file)
@@ -82,36 +82,36 @@ end:
 enum bt_scope bt_field_path_get_root_scope(
                const struct bt_field_path *field_path)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path, "Field path");
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
        return field_path->root;
 }
 
 uint64_t bt_field_path_get_item_count(const struct bt_field_path *field_path)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path, "Field path");
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
        return (uint64_t) field_path->items->len;
 }
 
 const struct bt_field_path_item *bt_field_path_borrow_item_by_index_const(
                const struct bt_field_path *field_path, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path, "Field path");
-       BT_ASSERT_PRE_VALID_INDEX(index, field_path->items->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path, "Field path");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, field_path->items->len);
        return bt_field_path_borrow_item_by_index_inline(field_path, index);
 }
 
 enum bt_field_path_item_type bt_field_path_item_get_type(
                const struct bt_field_path_item *field_path_item)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path_item, "Field path item");
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path_item, "Field path item");
        return field_path_item->type;
 }
 
 uint64_t bt_field_path_item_index_get_index(
                const struct bt_field_path_item *field_path_item)
 {
-       BT_ASSERT_PRE_NON_NULL(field_path_item, "Field path item");
-       BT_ASSERT_PRE(field_path_item->type == BT_FIELD_PATH_ITEM_TYPE_INDEX,
+       BT_ASSERT_PRE_DEV_NON_NULL(field_path_item, "Field path item");
+       BT_ASSERT_PRE_DEV(field_path_item->type == BT_FIELD_PATH_ITEM_TYPE_INDEX,
                "Field path item is not an index field path item: "
                "addr=%p, type=%s", field_path_item,
                bt_field_path_item_type_string(field_path_item->type));
index 805de0f8f63779f20c383a4115d7c07651a586b9..26def356315090b30d4bd6f42ae839db53babb9e 100644 (file)
@@ -185,20 +185,20 @@ void (* const field_destroy_funcs[])(struct bt_field *) = {
 
 struct bt_field_class *bt_field_borrow_class(const struct bt_field *field)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
        return field->class;
 }
 
 const struct bt_field_class *bt_field_borrow_class_const(
                const struct bt_field *field)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
        return field->class;
 }
 
 enum bt_field_class_type bt_field_get_class_type(const struct bt_field *field)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
        return field->class->type;
 }
 
@@ -207,7 +207,7 @@ struct bt_field *bt_field_create(struct bt_field_class *fc)
 {
        struct bt_field *field = NULL;
 
-       BT_ASSERT_PRE_NON_NULL(fc, "Field class");
+       BT_ASSERT(fc);
        BT_ASSERT(bt_field_class_has_known_type(fc));
        field = field_create_funcs[fc->type](fc);
        if (!field) {
@@ -496,9 +496,9 @@ int64_t bt_field_signed_integer_get_value(const struct bt_field *field)
 {
        const struct bt_field_integer *int_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SIGNED_INT(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(field, "Field");
        return int_field->value.i;
 }
 
@@ -506,10 +506,10 @@ void bt_field_signed_integer_set_value(struct bt_field *field, int64_t value)
 {
        struct bt_field_integer *int_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SIGNED_INT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE(bt_util_value_is_in_range_signed(
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV(bt_util_value_is_in_range_signed(
                ((struct bt_field_class_integer *) field->class)->range, value),
                "Value is out of bounds: value=%" PRId64 ", %![field-]+f, "
                "%![fc-]+F", value, field, field->class);
@@ -521,9 +521,9 @@ uint64_t bt_field_unsigned_integer_get_value(const struct bt_field *field)
 {
        const struct bt_field_integer *int_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_UNSIGNED_INT(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(field, "Field");
        return int_field->value.u;
 }
 
@@ -531,10 +531,10 @@ void bt_field_unsigned_integer_set_value(struct bt_field *field, uint64_t value)
 {
        struct bt_field_integer *int_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_UNSIGNED_INT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE(bt_util_value_is_in_range_unsigned(
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV(bt_util_value_is_in_range_unsigned(
                ((struct bt_field_class_integer *) field->class)->range, value),
                "Value is out of bounds: value=%" PRIu64 ", %![field-]+f, "
                "%![fc-]+F", value, field, field->class);
@@ -546,9 +546,9 @@ double bt_field_real_get_value(const struct bt_field *field)
 {
        const struct bt_field_real *real_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
        return real_field->value;
 }
 
@@ -556,10 +556,10 @@ void bt_field_real_set_value(struct bt_field *field, double value)
 {
        struct bt_field_real *real_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE(
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_REAL, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV(
                !((struct bt_field_class_real *) field->class)->is_single_precision ||
                (double) (float) value == value,
                "Invalid value for a single-precision real number: value=%f, "
@@ -576,11 +576,11 @@ bt_field_unsigned_enumeration_get_mapping_labels(
 {
        const struct bt_field_integer *int_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Count (output)");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, "Field");
        return (int)
                bt_field_class_unsigned_enumeration_get_mapping_labels_for_value(
@@ -595,11 +595,11 @@ bt_field_signed_enumeration_get_mapping_labels(
 {
        const struct bt_field_integer *int_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Label array (output)");
-       BT_ASSERT_PRE_NON_NULL(label_array, "Count (output)");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
+       BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, "Field");
        return (int)
                bt_field_class_signed_enumeration_get_mapping_labels_for_value(
@@ -610,9 +610,9 @@ const char *bt_field_string_get_value(const struct bt_field *field)
 {
        const struct bt_field_string *string_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        return (const char *) string_field->buf->data;
 }
@@ -621,9 +621,9 @@ uint64_t bt_field_string_get_length(const struct bt_field *field)
 {
        const struct bt_field_string *string_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_SET(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_SET(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        return string_field->length;
 }
@@ -641,10 +641,10 @@ void clear_string_field(struct bt_field *field)
 enum bt_field_string_set_value_status bt_field_string_set_value(
                struct bt_field *field, const char *value)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(value, "Value");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
                "Field");
        clear_string_field(field);
        return (int) bt_field_string_append_with_length(field, value,
@@ -665,14 +665,14 @@ enum bt_field_string_append_status bt_field_string_append_with_length(
        char *data;
        uint64_t new_length;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(value, "Value");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_STRING, "Field");
 
        /* Make sure no null bytes are appended */
-       BT_ASSERT_PRE(memchr(value, '\0', length) == NULL,
+       BT_ASSERT_PRE_DEV(memchr(value, '\0', length) == NULL,
                "String value to append contains a null character: "
                "partial-value=\"%.32s\", length=%" PRIu64, value, length);
 
@@ -692,9 +692,9 @@ enum bt_field_string_append_status bt_field_string_append_with_length(
 
 void bt_field_string_clear(struct bt_field *field)
 {
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_STRING, "Field");
        clear_string_field(field);
 }
@@ -703,8 +703,8 @@ uint64_t bt_field_array_get_length(const struct bt_field *field)
 {
        const struct bt_field_array *array_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_ARRAY(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(field, "Field");
        return array_field->length;
 }
 
@@ -714,10 +714,10 @@ enum bt_field_dynamic_array_set_length_status bt_field_dynamic_array_set_length(
        int ret = BT_FUNC_STATUS_OK;
        struct bt_field_array *array_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
 
        if (G_UNLIKELY(length > array_field->fields->len)) {
                /* Make more room */
@@ -759,9 +759,9 @@ struct bt_field *borrow_array_field_element_field_by_index(
 {
        struct bt_field_array *array_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_IS_ARRAY(field, "Field");
-       BT_ASSERT_PRE_VALID_INDEX(index, array_field->length);
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(field, "Field");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, array_field->length);
        return array_field->fields->pdata[index];
 }
 
@@ -784,10 +784,10 @@ struct bt_field *borrow_structure_field_member_field_by_index(
 {
        struct bt_field_structure *struct_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
-       BT_ASSERT_PRE_VALID_INDEX(index, struct_field->fields->len);
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, struct_field->fields->len);
        return struct_field->fields->pdata[index];
 }
 
@@ -816,9 +816,9 @@ struct bt_field *borrow_structure_field_member_field_by_name(
        gpointer orig_key;
        gpointer index;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_NON_NULL(name, "Field name");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_NON_NULL(name, "Field name");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_STRUCTURE, "Field");
        struct_fc = (void *) field->class;
 
@@ -853,10 +853,10 @@ struct bt_field *borrow_variant_field_selected_option_field(
 {
        struct bt_field_variant *var_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_VARIANT, "Field");
-       BT_ASSERT_PRE(var_field->selected_field,
+       BT_ASSERT_PRE_DEV(var_field->selected_field,
                "Variant field has no selected field: %!+f", field);
        return var_field->selected_field;
 }
@@ -879,11 +879,11 @@ bt_field_variant_select_option_field(
 {
        struct bt_field_variant *var_field = (void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_VARIANT, "Field");
-       BT_ASSERT_PRE_FIELD_HOT(field, "Field");
-       BT_ASSERT_PRE_VALID_INDEX(index, var_field->fields->len);
+       BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, var_field->fields->len);
        var_field->selected_field = var_field->fields->pdata[index];
        var_field->selected_index = index;
        return BT_FUNC_STATUS_OK;
@@ -894,10 +894,10 @@ uint64_t bt_field_variant_get_selected_option_field_index(
 {
        const struct bt_field_variant *var_field = (const void *) field;
 
-       BT_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field,
+       BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
+       BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field,
                BT_FIELD_CLASS_TYPE_VARIANT, "Field");
-       BT_ASSERT_PRE(var_field->selected_field,
+       BT_ASSERT_PRE_DEV(var_field->selected_field,
                "Variant field has no selected field: %!+f", field);
        return var_field->selected_index;
 }
index 96df03e749087db6209fb648ffaa1ffe169b0c38..f20378fcfc4edc9dc9f4c624fd7d1c0ebdb9b20c 100644 (file)
 #include "field-class.h"
 #include "utils.h"
 
-#define BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(_field, _cls_type, _name)   \
-       BT_ASSERT_PRE(((const struct bt_field *) (_field))->class->type == (_cls_type), \
+#define BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(_field, _cls_type, _name) \
+       BT_ASSERT_PRE_DEV(((const struct bt_field *) (_field))->class->type == (_cls_type), \
                _name " has the wrong class type: expected-class-type=%s, " \
                "%![field-]+f",                                         \
                bt_common_field_class_type_string(_cls_type), (_field))
 
-#define BT_ASSERT_PRE_FIELD_IS_UNSIGNED_INT(_field, _name)             \
-       BT_ASSERT_PRE(                                                  \
+#define BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(_field, _name)         \
+       BT_ASSERT_PRE_DEV(                                              \
                ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || \
                ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, \
                _name " is not an unsigned integer field: %![field-]+f", \
                (_field))
 
-#define BT_ASSERT_PRE_FIELD_IS_SIGNED_INT(_field, _name)               \
-       BT_ASSERT_PRE(                                                  \
+#define BT_ASSERT_PRE_DEV_FIELD_IS_SIGNED_INT(_field, _name)           \
+       BT_ASSERT_PRE_DEV(                                              \
                ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || \
                ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, \
-               _name " is not a signed integer field: %![field-]+f", \
+               _name " is not a signed integer field: %![field-]+f",   \
                (_field))
 
-#define BT_ASSERT_PRE_FIELD_IS_ARRAY(_field, _name)                    \
-       BT_ASSERT_PRE(                                                  \
+#define BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(_field, _name)                        \
+       BT_ASSERT_PRE_DEV(                                              \
                ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
                ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, \
                _name " is not an array field: %![field-]+f", (_field))
 
-#define BT_ASSERT_PRE_FIELD_IS_SET(_field, _name)                      \
-       BT_ASSERT_PRE(bt_field_is_set(_field),                          \
+#define BT_ASSERT_PRE_DEV_FIELD_IS_SET(_field, _name)                  \
+       BT_ASSERT_PRE_DEV(bt_field_is_set(_field),                      \
                _name " is not set: %!+f", (_field))
 
-#define BT_ASSERT_PRE_FIELD_HOT(_field, _name)                         \
-       BT_ASSERT_PRE_HOT((const struct bt_field *) (_field), (_name),  \
+#define BT_ASSERT_PRE_DEV_FIELD_HOT(_field, _name)                     \
+       BT_ASSERT_PRE_DEV_HOT((const struct bt_field *) (_field), (_name), \
                ": %!+f", (_field))
 
 struct bt_field;
index 8f8625b6123b7f7b9ea8b2f46b62dd4200f80126..78fb18a2a80f321f2b65c2b7a83181c81c09d930 100644 (file)
 #include "trace.h"
 #include "lib/func-status.h"
 
-#define BT_ASSERT_PRE_PACKET_HOT(_packet) \
-       BT_ASSERT_PRE_HOT((_packet), "Packet", ": %!+a", (_packet))
-
 struct bt_stream *bt_packet_borrow_stream(struct bt_packet *packet)
 {
-       BT_ASSERT_PRE_NON_NULL(packet, "Packet");
+       BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet");
        return packet->stream;
 }
 
@@ -58,7 +55,7 @@ const struct bt_stream *bt_packet_borrow_stream_const(
 
 struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet)
 {
-       BT_ASSERT_PRE_NON_NULL(packet, "Packet");
+       BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet");
        return packet->context_field ? packet->context_field->field : NULL;
 }
 
@@ -250,14 +247,14 @@ enum bt_packet_move_context_field_status bt_packet_move_context_field(
        struct bt_stream_class *stream_class;
        struct bt_field_wrapper *field_wrapper = (void *) context_field;
 
-       BT_ASSERT_PRE_NON_NULL(packet, "Packet");
-       BT_ASSERT_PRE_NON_NULL(field_wrapper, "Context field");
-       BT_ASSERT_PRE_HOT(packet, "Packet", ": %!+a", packet);
+       BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet");
+       BT_ASSERT_PRE_DEV_NON_NULL(field_wrapper, "Context field");
+       BT_ASSERT_PRE_DEV_HOT(packet, "Packet", ": %!+a", packet);
        stream_class = packet->stream->class;
-       BT_ASSERT_PRE(stream_class->packet_context_fc,
+       BT_ASSERT_PRE_DEV(stream_class->packet_context_fc,
                "Stream class has no packet context field class: %!+S",
                stream_class);
-       BT_ASSERT_PRE(field_wrapper->field->class ==
+       BT_ASSERT_PRE_DEV(field_wrapper->field->class ==
                stream_class->packet_context_fc,
                "Unexpected packet context field's class: "
                "%![fc-]+F, %![expected-fc-]+F", field_wrapper->field->class,
index ed44e059e7dcba5c5284d79557770e22bcafbc1b..59fc0164f53bdc656b37816de67a9c0eb59e11d6 100644 (file)
@@ -166,7 +166,7 @@ end:
        return field_path;
 }
 
-BT_ASSERT_PRE_FUNC
+BT_ASSERT_PRE_DEV_FUNC
 static inline
 bool target_is_before_source(struct bt_field_path *src_field_path,
                struct bt_field_path *tgt_field_path)
@@ -210,7 +210,7 @@ end:
        return is_valid;
 }
 
-BT_ASSERT_PRE_FUNC
+BT_ASSERT_PRE_DEV_FUNC
 static inline
 struct bt_field_class *borrow_root_field_class(
                struct bt_resolve_field_path_context *ctx, enum bt_scope scope)
@@ -231,7 +231,7 @@ struct bt_field_class *borrow_root_field_class(
        return NULL;
 }
 
-BT_ASSERT_PRE_FUNC
+BT_ASSERT_PRE_DEV_FUNC
 static inline
 struct bt_field_class *borrow_child_field_class(
                struct bt_field_class *parent_fc,
@@ -268,7 +268,7 @@ struct bt_field_class *borrow_child_field_class(
        return child_fc;
 }
 
-BT_ASSERT_PRE_FUNC
+BT_ASSERT_PRE_DEV_FUNC
 static inline
 bool target_field_path_in_different_scope_has_struct_fc_only(
                struct bt_field_path *src_field_path,
@@ -305,7 +305,7 @@ end:
        return is_valid;
 }
 
-BT_ASSERT_PRE_FUNC
+BT_ASSERT_PRE_DEV_FUNC
 static inline
 bool lca_is_structure_field_class(struct bt_field_path *src_field_path,
                struct bt_field_path *tgt_field_path,
@@ -361,7 +361,7 @@ end:
        return is_valid;
 }
 
-BT_ASSERT_PRE_FUNC
+BT_ASSERT_PRE_DEV_FUNC
 static inline
 bool lca_to_target_has_struct_fc_only(struct bt_field_path *src_field_path,
                struct bt_field_path *tgt_field_path,
@@ -421,7 +421,7 @@ end:
        return is_valid;
 }
 
-BT_ASSERT_PRE_FUNC
+BT_ASSERT_PRE_DEV_FUNC
 static inline
 bool field_path_is_valid(struct bt_field_class *src_fc,
                struct bt_field_class *tgt_fc,
@@ -434,14 +434,14 @@ bool field_path_is_valid(struct bt_field_class *src_fc,
                tgt_fc, ctx);
 
        if (!src_field_path) {
-               BT_ASSERT_PRE_MSG("Cannot find requesting field class in "
+               BT_ASSERT_PRE_DEV_MSG("Cannot find requesting field class in "
                        "resolving context: %!+F", src_fc);
                is_valid = false;
                goto end;
        }
 
        if (!tgt_field_path) {
-               BT_ASSERT_PRE_MSG("Cannot find target field class in "
+               BT_ASSERT_PRE_DEV_MSG("Cannot find target field class in "
                        "resolving context: %!+F", tgt_fc);
                is_valid = false;
                goto end;
@@ -449,7 +449,7 @@ bool field_path_is_valid(struct bt_field_class *src_fc,
 
        /* Target must be before source */
        if (!target_is_before_source(src_field_path, tgt_field_path)) {
-               BT_ASSERT_PRE_MSG("Target field class is located after "
+               BT_ASSERT_PRE_DEV_MSG("Target field class is located after "
                        "requesting field class: %![req-fc-]+F, %![tgt-fc-]+F",
                        src_fc, tgt_fc);
                is_valid = false;
@@ -462,7 +462,7 @@ bool field_path_is_valid(struct bt_field_class *src_fc,
         */
        if (!target_field_path_in_different_scope_has_struct_fc_only(
                        src_field_path, tgt_field_path, ctx)) {
-               BT_ASSERT_PRE_MSG("Target field class is located in a "
+               BT_ASSERT_PRE_DEV_MSG("Target field class is located in a "
                        "different scope than requesting field class, "
                        "but within an array or a variant field class: "
                        "%![req-fc-]+F, %![tgt-fc-]+F",
@@ -473,7 +473,7 @@ bool field_path_is_valid(struct bt_field_class *src_fc,
 
        /* Same scope: LCA must be a structure field class */
        if (!lca_is_structure_field_class(src_field_path, tgt_field_path, ctx)) {
-               BT_ASSERT_PRE_MSG("Lowest common ancestor of target and "
+               BT_ASSERT_PRE_DEV_MSG("Lowest common ancestor of target and "
                        "requesting field classes is not a structure field class: "
                        "%![req-fc-]+F, %![tgt-fc-]+F",
                        src_fc, tgt_fc);
@@ -484,7 +484,7 @@ bool field_path_is_valid(struct bt_field_class *src_fc,
        /* Same scope: path from LCA to target has no array/variant FTs */
        if (!lca_to_target_has_struct_fc_only(src_field_path, tgt_field_path,
                        ctx)) {
-               BT_ASSERT_PRE_MSG("Path from lowest common ancestor of target "
+               BT_ASSERT_PRE_DEV_MSG("Path from lowest common ancestor of target "
                        "and requesting field classes to target field class "
                        "contains an array or a variant field class: "
                        "%![req-fc-]+F, %![tgt-fc-]+F", src_fc, tgt_fc);
@@ -503,7 +503,7 @@ struct bt_field_path *resolve_field_path(struct bt_field_class *src_fc,
                struct bt_field_class *tgt_fc,
                struct bt_resolve_field_path_context *ctx)
 {
-       BT_ASSERT_PRE(field_path_is_valid(src_fc, tgt_fc, ctx),
+       BT_ASSERT_PRE_DEV(field_path_is_valid(src_fc, tgt_fc, ctx),
                "Invalid target field class: %![req-fc-]+F, %![tgt-fc-]+F",
                src_fc, tgt_fc);
        return find_field_class_in_ctx(tgt_fc, ctx);
index edeccbecc730391c62857f6c371839da5c9bccbb..aeccff72cac2e12f0ebd4779afbf12463fbee151 100644 (file)
@@ -46,8 +46,8 @@
 #include "utils.h"
 #include "lib/func-status.h"
 
-#define BT_ASSERT_PRE_STREAM_CLASS_HOT(_sc) \
-       BT_ASSERT_PRE_HOT((_sc), "Stream class", ": %!+S", (_sc))
+#define BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(_sc) \
+       BT_ASSERT_PRE_DEV_HOT((_sc), "Stream class", ": %!+S", (_sc))
 
 static
 void destroy_stream_class(struct bt_object *obj)
@@ -192,7 +192,7 @@ struct bt_stream_class *bt_stream_class_create_with_id(
 struct bt_trace_class *bt_stream_class_borrow_trace_class(
                struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return bt_stream_class_borrow_trace_class_inline(stream_class);
 }
 
@@ -204,7 +204,7 @@ const struct bt_trace_class *bt_stream_class_borrow_trace_class_const(
 
 const char *bt_stream_class_get_name(const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return stream_class->name.value;
 }
 
@@ -214,7 +214,7 @@ enum bt_stream_class_set_name_status bt_stream_class_set_name(
 {
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        g_string_assign(stream_class->name.str, name);
        stream_class->name.value = stream_class->name.str->str;
        BT_LIB_LOGD("Set stream class's name: %!+S", stream_class);
@@ -223,22 +223,22 @@ enum bt_stream_class_set_name_status bt_stream_class_set_name(
 
 uint64_t bt_stream_class_get_id(const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return stream_class->id;
 }
 
 uint64_t bt_stream_class_get_event_class_count(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (uint64_t) stream_class->event_classes->len;
 }
 
 struct bt_event_class *bt_stream_class_borrow_event_class_by_index(
                struct bt_stream_class *stream_class, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
-       BT_ASSERT_PRE_VALID_INDEX(index, stream_class->event_classes->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, stream_class->event_classes->len);
        return g_ptr_array_index(stream_class->event_classes, index);
 }
 
@@ -256,7 +256,7 @@ struct bt_event_class *bt_stream_class_borrow_event_class_by_id(
        struct bt_event_class *event_class = NULL;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
 
        for (i = 0; i < stream_class->event_classes->len; i++) {
                struct bt_event_class *event_class_candidate =
@@ -284,7 +284,7 @@ const struct bt_field_class *
 bt_stream_class_borrow_packet_context_field_class_const(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return stream_class->packet_context_fc;
 }
 
@@ -292,7 +292,7 @@ struct bt_field_class *
 bt_stream_class_borrow_packet_context_field_class(
                struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return stream_class->packet_context_fc;
 }
 
@@ -314,7 +314,7 @@ bt_stream_class_set_packet_context_field_class(
                "Stream class does not support packets: %![sc-]+S",
                stream_class);
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
                BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Packet context field class is not a structure field class: %!+F",
@@ -346,7 +346,7 @@ const struct bt_field_class *
 bt_stream_class_borrow_event_common_context_field_class_const(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return stream_class->event_common_context_fc;
 }
 
@@ -354,7 +354,7 @@ struct bt_field_class *
 bt_stream_class_borrow_event_common_context_field_class(
                struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return stream_class->event_common_context_fc;
 }
 
@@ -373,7 +373,7 @@ bt_stream_class_set_event_common_context_field_class(
 
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
        BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
                BT_FIELD_CLASS_TYPE_STRUCTURE,
                "Event common context field class is not a structure field class: %!+F",
@@ -418,7 +418,7 @@ bt_stream_class_set_default_clock_class(
 {
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
        BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        bt_object_put_ref(stream_class->default_clock_class);
        stream_class->default_clock_class = clock_class;
        bt_object_get_no_null_check(stream_class->default_clock_class);
@@ -431,21 +431,21 @@ bt_stream_class_set_default_clock_class(
 struct bt_clock_class *bt_stream_class_borrow_default_clock_class(
                struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return stream_class->default_clock_class;
 }
 
 const struct bt_clock_class *bt_stream_class_borrow_default_clock_class_const(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return stream_class->default_clock_class;
 }
 
 bt_bool bt_stream_class_assigns_automatic_event_class_id(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (bt_bool) stream_class->assigns_automatic_event_class_id;
 }
 
@@ -454,7 +454,7 @@ void bt_stream_class_set_assigns_automatic_event_class_id(
                bt_bool value)
 {
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        stream_class->assigns_automatic_event_class_id = (bool) value;
        BT_LIB_LOGD("Set stream class's automatic event class ID "
                "assignment property: %!+S", stream_class);
@@ -463,7 +463,7 @@ void bt_stream_class_set_assigns_automatic_event_class_id(
 bt_bool bt_stream_class_assigns_automatic_stream_id(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (bt_bool) stream_class->assigns_automatic_stream_id;
 }
 
@@ -473,7 +473,7 @@ void bt_stream_class_set_supports_discarded_events(
                bt_bool with_default_clock_snapshots)
 {
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        BT_ASSERT_PRE(supports_discarded_events ||
                !with_default_clock_snapshots,
                "Discarded events cannot have default clock snapshots when "
@@ -492,14 +492,14 @@ void bt_stream_class_set_supports_discarded_events(
 bt_bool bt_stream_class_supports_discarded_events(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (bt_bool) stream_class->supports_discarded_events;
 }
 
 bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (bt_bool) stream_class->discarded_events_have_default_clock_snapshots;
 }
 
@@ -509,7 +509,7 @@ void bt_stream_class_set_supports_discarded_packets(
                bt_bool with_default_clock_snapshots)
 {
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        BT_ASSERT_PRE(!supports_discarded_packets ||
                stream_class->supports_packets,
                "Stream class does not support packets: %!+S",
@@ -532,14 +532,14 @@ void bt_stream_class_set_supports_discarded_packets(
 bt_bool bt_stream_class_supports_discarded_packets(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (bt_bool) stream_class->supports_discarded_packets;
 }
 
 bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (bt_bool) stream_class->discarded_packets_have_default_clock_snapshots;
 }
 
@@ -553,7 +553,7 @@ void bt_stream_class_set_supports_packets(
                with_beginning_default_clock_snapshot ||
                with_end_default_clock_snapshot;
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        BT_ASSERT_PRE(supports_packets ||
                !with_default_clock_snapshot,
                "Packets cannot have default clock snapshots when "
@@ -587,14 +587,14 @@ bt_bool bt_stream_class_supports_packets(
 bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (bt_bool) stream_class->packets_have_beginning_default_clock_snapshot;
 }
 
 bt_bool bt_stream_class_packets_have_end_default_clock_snapshot(
                const struct bt_stream_class *stream_class)
 {
-       BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream_class, "Stream class");
        return (bt_bool) stream_class->packets_have_end_default_clock_snapshot;
 }
 
@@ -603,7 +603,7 @@ void bt_stream_class_set_assigns_automatic_stream_id(
                bt_bool value)
 {
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
-       BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
+       BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
        stream_class->assigns_automatic_stream_id = (bool) value;
        BT_LIB_LOGD("Set stream class's automatic stream ID "
                "assignment property: %!+S", stream_class);
index 81f212da57865856c9ba5beb52414f77df8795b6..bac7cc5af557003421a151acc7fea9f865fcf2eb 100644 (file)
@@ -42,8 +42,8 @@
 #include "trace.h"
 #include "lib/func-status.h"
 
-#define BT_ASSERT_PRE_STREAM_HOT(_stream) \
-       BT_ASSERT_PRE_HOT((_stream), "Stream", ": %!+s", (_stream))
+#define BT_ASSERT_PRE_DEV_STREAM_HOT(_stream) \
+       BT_ASSERT_PRE_DEV_HOT((_stream), "Stream", ": %!+s", (_stream))
 
 static
 void destroy_stream(struct bt_object *obj)
@@ -180,7 +180,7 @@ struct bt_stream *bt_stream_create_with_id(struct bt_stream_class *stream_class,
 
 struct bt_stream_class *bt_stream_borrow_class(struct bt_stream *stream)
 {
-       BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
        return stream->class;
 }
 
@@ -192,7 +192,7 @@ const struct bt_stream_class *bt_stream_borrow_class_const(
 
 struct bt_trace *bt_stream_borrow_trace(struct bt_stream *stream)
 {
-       BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
        return bt_stream_borrow_trace_inline(stream);
 }
 
@@ -204,7 +204,7 @@ const struct bt_trace *bt_stream_borrow_trace_const(
 
 const char *bt_stream_get_name(const struct bt_stream *stream)
 {
-       BT_ASSERT_PRE_NON_NULL(stream, "Stream");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream");
        return stream->name.value;
 }
 
@@ -213,7 +213,7 @@ enum bt_stream_set_name_status bt_stream_set_name(struct bt_stream *stream,
 {
        BT_ASSERT_PRE_NON_NULL(stream, "Stream");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
-       BT_ASSERT_PRE_STREAM_HOT(stream);
+       BT_ASSERT_PRE_DEV_STREAM_HOT(stream);
        g_string_assign(stream->name.str, name);
        stream->name.value = stream->name.str->str;
        BT_LIB_LOGD("Set stream's name: %!+s", stream);
@@ -222,7 +222,7 @@ enum bt_stream_set_name_status bt_stream_set_name(struct bt_stream *stream,
 
 uint64_t bt_stream_get_id(const struct bt_stream *stream)
 {
-       BT_ASSERT_PRE_NON_NULL(stream, "Stream class");
+       BT_ASSERT_PRE_DEV_NON_NULL(stream, "Stream class");
        return stream->id;
 }
 
index 9ad5849f78c5a0f7e93d89107eec8de5ab3e45c4..23a6a7e7b3450db0f9176d5a2ed63df46850d0c7 100644 (file)
@@ -60,8 +60,8 @@ struct bt_trace_class_destruction_listener_elem {
        void *data;
 };
 
-#define BT_ASSERT_PRE_TRACE_CLASS_HOT(_tc)                             \
-       BT_ASSERT_PRE_HOT((_tc), "Trace class", ": %!+T", (_tc))
+#define BT_ASSERT_PRE_DEV_TRACE_CLASS_HOT(_tc)                         \
+       BT_ASSERT_PRE_DEV_HOT((_tc), "Trace class", ": %!+T", (_tc))
 
 static
 void destroy_trace_class(struct bt_object *obj)
@@ -233,15 +233,15 @@ enum bt_trace_class_remove_listener_status bt_trace_class_remove_destruction_lis
 
 uint64_t bt_trace_class_get_stream_class_count(const struct bt_trace_class *tc)
 {
-       BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
+       BT_ASSERT_PRE_DEV_NON_NULL(tc, "Trace class");
        return (uint64_t) tc->stream_classes->len;
 }
 
 struct bt_stream_class *bt_trace_class_borrow_stream_class_by_index(
                struct bt_trace_class *tc, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
-       BT_ASSERT_PRE_VALID_INDEX(index, tc->stream_classes->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(tc, "Trace class");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, tc->stream_classes->len);
        return g_ptr_array_index(tc->stream_classes, index);
 }
 
@@ -259,7 +259,7 @@ struct bt_stream_class *bt_trace_class_borrow_stream_class_by_id(
        struct bt_stream_class *stream_class = NULL;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
+       BT_ASSERT_PRE_DEV_NON_NULL(tc, "Trace class");
 
        for (i = 0; i < tc->stream_classes->len; i++) {
                struct bt_stream_class *stream_class_candidate =
@@ -292,7 +292,7 @@ void _bt_trace_class_freeze(const struct bt_trace_class *tc)
 
 bt_bool bt_trace_class_assigns_automatic_stream_class_id(const struct bt_trace_class *tc)
 {
-       BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
+       BT_ASSERT_PRE_DEV_NON_NULL(tc, "Trace class");
        return (bt_bool) tc->assigns_automatic_stream_class_id;
 }
 
@@ -300,7 +300,7 @@ void bt_trace_class_set_assigns_automatic_stream_class_id(struct bt_trace_class
                bt_bool value)
 {
        BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
-       BT_ASSERT_PRE_TRACE_CLASS_HOT(tc);
+       BT_ASSERT_PRE_DEV_TRACE_CLASS_HOT(tc);
        tc->assigns_automatic_stream_class_id = (bool) value;
        BT_LIB_LOGD("Set trace class's automatic stream class ID "
                "assignment property: %!+T", tc);
index 8b6650dbe11c5339e36e7e4c5ee9c957515b1c16..6deecb1d80d4eef7f24ba673c00126b3f0eaefa7 100644 (file)
@@ -62,8 +62,8 @@ struct bt_trace_destruction_listener_elem {
        void *data;
 };
 
-#define BT_ASSERT_PRE_TRACE_HOT(_trace) \
-       BT_ASSERT_PRE_HOT((_trace), "Trace", ": %!+t", (_trace))
+#define BT_ASSERT_PRE_DEV_TRACE_HOT(_trace) \
+       BT_ASSERT_PRE_DEV_HOT((_trace), "Trace", ": %!+t", (_trace))
 
 static
 void destroy_trace(struct bt_object *obj)
@@ -200,7 +200,7 @@ end:
 
 const char *bt_trace_get_name(const struct bt_trace *trace)
 {
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
        return trace->name.value;
 }
 
@@ -209,7 +209,7 @@ enum bt_trace_set_name_status bt_trace_set_name(struct bt_trace *trace,
 {
        BT_ASSERT_PRE_NON_NULL(trace, "Trace");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
-       BT_ASSERT_PRE_TRACE_HOT(trace);
+       BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
        g_string_assign(trace->name.str, name);
        trace->name.value = trace->name.str->str;
        BT_LIB_LOGD("Set trace's name: %!+t", trace);
@@ -218,7 +218,7 @@ enum bt_trace_set_name_status bt_trace_set_name(struct bt_trace *trace,
 
 bt_uuid bt_trace_get_uuid(const struct bt_trace *trace)
 {
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
        return trace->uuid.value;
 }
 
@@ -226,7 +226,7 @@ void bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid)
 {
        BT_ASSERT_PRE_NON_NULL(trace, "Trace");
        BT_ASSERT_PRE_NON_NULL(uuid, "UUID");
-       BT_ASSERT_PRE_TRACE_HOT(trace);
+       BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
        bt_uuid_copy(trace->uuid.uuid, uuid);
        trace->uuid.value = trace->uuid.uuid;
        BT_LIB_LOGD("Set trace's UUID: %!+t", trace);
@@ -325,7 +325,7 @@ uint64_t bt_trace_get_environment_entry_count(const struct bt_trace *trace)
 {
        int64_t ret;
 
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
        ret = bt_attributes_get_count(trace->environment);
        BT_ASSERT(ret >= 0);
        return (uint64_t) ret;
@@ -335,10 +335,10 @@ void bt_trace_borrow_environment_entry_by_index_const(
                const struct bt_trace *trace, uint64_t index,
                const char **name, const struct bt_value **value)
 {
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
-       BT_ASSERT_PRE_NON_NULL(name, "Name");
-       BT_ASSERT_PRE_NON_NULL(value, "Value");
-       BT_ASSERT_PRE_VALID_INDEX(index,
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
+       BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index,
                bt_attributes_get_count(trace->environment));
        *value = bt_attributes_borrow_field_value(trace->environment, index);
        BT_ASSERT(*value);
@@ -349,23 +349,23 @@ void bt_trace_borrow_environment_entry_by_index_const(
 const struct bt_value *bt_trace_borrow_environment_entry_value_by_name_const(
                const struct bt_trace *trace, const char *name)
 {
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
-       BT_ASSERT_PRE_NON_NULL(name, "Name");
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
        return bt_attributes_borrow_field_value_by_name(trace->environment,
                name);
 }
 
 uint64_t bt_trace_get_stream_count(const struct bt_trace *trace)
 {
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
        return (uint64_t) trace->streams->len;
 }
 
 struct bt_stream *bt_trace_borrow_stream_by_index(
                struct bt_trace *trace, uint64_t index)
 {
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
-       BT_ASSERT_PRE_VALID_INDEX(index, trace->streams->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, trace->streams->len);
        return g_ptr_array_index(trace->streams, index);
 }
 
@@ -381,7 +381,7 @@ struct bt_stream *bt_trace_borrow_stream_by_id(struct bt_trace *trace,
        struct bt_stream *stream = NULL;
        uint64_t i;
 
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
 
        for (i = 0; i < trace->streams->len; i++) {
                struct bt_stream *stream_candidate =
@@ -526,7 +526,7 @@ uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace,
 
 struct bt_trace_class *bt_trace_borrow_class(struct bt_trace *trace)
 {
-       BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+       BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
        return trace->class;
 }
 
index 0d42e8795ba22b8133c04ab0d72a3a6f29674f74..4f5d55e017c85b5633284ec77de506efda10a9ee 100644 (file)
 #define BT_VALUE_TO_ARRAY(_base) ((struct bt_value_array *) (_base))
 #define BT_VALUE_TO_MAP(_base) ((struct bt_value_map *) (_base))
 
-#define BT_ASSERT_PRE_VALUE_IS_TYPE(_value, _type)                     \
-       BT_ASSERT_PRE(((struct bt_value *) (_value))->type == (_type),  \
-               "Value has the wrong type ID: expected-type=%s, "       \
-               "%![value-]+v", bt_common_value_type_string(_type),     \
-               (_value))
+#define _BT_ASSERT_PRE_VALUE_IS_TYPE_COND(_value, _type)               \
+       (((struct bt_value *) (_value))->type == (_type))
 
-#define BT_ASSERT_PRE_VALUE_HOT(_value, _name)                         \
-       BT_ASSERT_PRE_HOT(((struct bt_value *) (_value)), (_name),      \
-               ": %!+v", (_value))
+#define _BT_ASSERT_PRE_VALUE_IS_TYPE_FMT                               \
+       "Value has the wrong type ID: expected-type=%s, %![value-]+v"
 
-#define BT_ASSERT_PRE_VALUE_INDEX_IN_BOUNDS(_index, _count)            \
-       BT_ASSERT_PRE((_index) < (_count),                              \
-               "Index is out of bound: "                               \
-               "index=%" PRIu64 ", count=%u", (_index), (_count));
+#define BT_ASSERT_PRE_VALUE_IS_TYPE(_value, _type)                     \
+       BT_ASSERT_PRE(                                                  \
+               _BT_ASSERT_PRE_VALUE_IS_TYPE_COND((_value), (_type)),   \
+               _BT_ASSERT_PRE_VALUE_IS_TYPE_FMT,                       \
+               bt_common_value_type_string(_type), (_value))
+
+#define BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(_value, _type)                 \
+       BT_ASSERT_PRE_DEV(                                              \
+               _BT_ASSERT_PRE_VALUE_IS_TYPE_COND((_value), (_type)),   \
+               _BT_ASSERT_PRE_VALUE_IS_TYPE_FMT,                       \
+               bt_common_value_type_string(_type), (_value))
+
+#define BT_ASSERT_PRE_DEV_VALUE_HOT(_value, _name)                     \
+       BT_ASSERT_PRE_DEV_HOT(((struct bt_value *) (_value)), (_name),  \
+               ": %!+v", (_value))
 
 static
 void bt_value_null_instance_release_func(struct bt_object *obj)
@@ -563,7 +570,7 @@ end:
 
 enum bt_value_type bt_value_get_type(const struct bt_value *object)
 {
-       BT_ASSERT_PRE_NON_NULL(object, "Value object");
+       BT_ASSERT_PRE_DEV_NON_NULL(object, "Value object");
        return object->type;
 }
 
@@ -779,8 +786,8 @@ end:
 
 bt_bool bt_value_bool_get(const struct bt_value *bool_obj)
 {
-       BT_ASSERT_PRE_NON_NULL(bool_obj, "Value object");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL);
+       BT_ASSERT_PRE_DEV_NON_NULL(bool_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL);
        return BT_VALUE_TO_BOOL(bool_obj)->value;
 }
 
@@ -788,7 +795,7 @@ void bt_value_bool_set(struct bt_value *bool_obj, bt_bool val)
 {
        BT_ASSERT_PRE_NON_NULL(bool_obj, "Value object");
        BT_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL);
-       BT_ASSERT_PRE_VALUE_HOT(bool_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_HOT(bool_obj, "Value object");
        BT_VALUE_TO_BOOL(bool_obj)->value = val;
        BT_LOGT("Set boolean value's raw value: value-addr=%p, value=%d",
                bool_obj, val);
@@ -796,16 +803,16 @@ void bt_value_bool_set(struct bt_value *bool_obj, bt_bool val)
 
 uint64_t bt_value_unsigned_integer_get(const struct bt_value *integer_obj)
 {
-       BT_ASSERT_PRE_NON_NULL(integer_obj, "Value object");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(integer_obj,
+       BT_ASSERT_PRE_DEV_NON_NULL(integer_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(integer_obj,
                BT_VALUE_TYPE_UNSIGNED_INTEGER);
        return BT_VALUE_TO_INTEGER(integer_obj)->value.u;
 }
 
 int64_t bt_value_signed_integer_get(const struct bt_value *integer_obj)
 {
-       BT_ASSERT_PRE_NON_NULL(integer_obj, "Value object");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(integer_obj,
+       BT_ASSERT_PRE_DEV_NON_NULL(integer_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(integer_obj,
                BT_VALUE_TYPE_SIGNED_INTEGER);
        return BT_VALUE_TO_INTEGER(integer_obj)->value.i;
 }
@@ -816,7 +823,7 @@ void bt_value_integer_set(struct bt_value *integer_obj,
 {
        BT_ASSERT_PRE_NON_NULL(integer_obj, "Value object");
        BT_ASSERT_PRE_VALUE_IS_TYPE(integer_obj, expected_type);
-       BT_ASSERT_PRE_VALUE_HOT(integer_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_HOT(integer_obj, "Value object");
        BT_VALUE_TO_INTEGER(integer_obj)->value.u = uval;
 }
 
@@ -839,8 +846,8 @@ void bt_value_signed_integer_set(struct bt_value *integer_obj,
 
 double bt_value_real_get(const struct bt_value *real_obj)
 {
-       BT_ASSERT_PRE_NON_NULL(real_obj, "Value object");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(real_obj, BT_VALUE_TYPE_REAL);
+       BT_ASSERT_PRE_DEV_NON_NULL(real_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(real_obj, BT_VALUE_TYPE_REAL);
        return BT_VALUE_TO_REAL(real_obj)->value;
 }
 
@@ -848,7 +855,7 @@ void bt_value_real_set(struct bt_value *real_obj, double val)
 {
        BT_ASSERT_PRE_NON_NULL(real_obj, "Value object");
        BT_ASSERT_PRE_VALUE_IS_TYPE(real_obj, BT_VALUE_TYPE_REAL);
-       BT_ASSERT_PRE_VALUE_HOT(real_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_HOT(real_obj, "Value object");
        BT_VALUE_TO_REAL(real_obj)->value = val;
        BT_LOGT("Set real number value's raw value: value-addr=%p, value=%f",
                real_obj, val);
@@ -856,8 +863,8 @@ void bt_value_real_set(struct bt_value *real_obj, double val)
 
 const char *bt_value_string_get(const struct bt_value *string_obj)
 {
-       BT_ASSERT_PRE_NON_NULL(string_obj, "Value object");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
+       BT_ASSERT_PRE_DEV_NON_NULL(string_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
        return BT_VALUE_TO_STRING(string_obj)->gstr->str;
 }
 
@@ -866,7 +873,7 @@ enum bt_value_string_set_status bt_value_string_set(
 {
        BT_ASSERT_PRE_NON_NULL(string_obj, "Value object");
        BT_ASSERT_PRE_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
-       BT_ASSERT_PRE_VALUE_HOT(string_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_HOT(string_obj, "Value object");
        g_string_assign(BT_VALUE_TO_STRING(string_obj)->gstr, val);
        BT_LOGT("Set string value's raw value: value-addr=%p, raw-value-addr=%p",
                string_obj, val);
@@ -875,8 +882,8 @@ enum bt_value_string_set_status bt_value_string_set(
 
 uint64_t bt_value_array_get_size(const struct bt_value *array_obj)
 {
-       BT_ASSERT_PRE_NON_NULL(array_obj, "Value object");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
+       BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
        return (uint64_t) BT_VALUE_TO_ARRAY(array_obj)->garray->len;
 }
 
@@ -886,10 +893,9 @@ struct bt_value *bt_value_array_borrow_element_by_index(
        struct bt_value_array *typed_array_obj =
                BT_VALUE_TO_ARRAY(array_obj);
 
-       BT_ASSERT_PRE_NON_NULL(array_obj, "Value object");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
-       BT_ASSERT_PRE_VALUE_INDEX_IN_BOUNDS(index,
-               typed_array_obj->garray->len);
+       BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
+       BT_ASSERT_PRE_DEV_VALID_INDEX(index, typed_array_obj->garray->len);
        return g_ptr_array_index(typed_array_obj->garray, index);
 }
 
@@ -911,7 +917,7 @@ enum bt_value_array_append_element_status bt_value_array_append_element(
        BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
        BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
        BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
-       BT_ASSERT_PRE_VALUE_HOT(array_obj, "Array value object");
+       BT_ASSERT_PRE_DEV_VALUE_HOT(array_obj, "Array value object");
        g_ptr_array_add(typed_array_obj->garray, element_obj);
        bt_object_get_ref(element_obj);
        BT_LOGT("Appended element to array value: array-value-addr=%p, "
@@ -1024,9 +1030,8 @@ bt_value_array_set_element_by_index(struct bt_value *array_obj, uint64_t index,
        BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
        BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
        BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
-       BT_ASSERT_PRE_VALUE_HOT(array_obj, "Array value object");
-       BT_ASSERT_PRE_VALUE_INDEX_IN_BOUNDS(index,
-               typed_array_obj->garray->len);
+       BT_ASSERT_PRE_DEV_VALUE_HOT(array_obj, "Array value object");
+       BT_ASSERT_PRE_VALID_INDEX(index, typed_array_obj->garray->len);
        bt_object_put_ref(g_ptr_array_index(typed_array_obj->garray, index));
        g_ptr_array_index(typed_array_obj->garray, index) = element_obj;
        bt_object_get_ref(element_obj);
@@ -1038,17 +1043,17 @@ bt_value_array_set_element_by_index(struct bt_value *array_obj, uint64_t index,
 
 uint64_t bt_value_map_get_size(const struct bt_value *map_obj)
 {
-       BT_ASSERT_PRE_NON_NULL(map_obj, "Value object");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
+       BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
        return (uint64_t) g_hash_table_size(BT_VALUE_TO_MAP(map_obj)->ght);
 }
 
 struct bt_value *bt_value_map_borrow_entry_value(struct bt_value *map_obj,
                const char *key)
 {
-       BT_ASSERT_PRE_NON_NULL(map_obj, "Value object");
-       BT_ASSERT_PRE_NON_NULL(key, "Key");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
+       BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
+       BT_ASSERT_PRE_DEV_NON_NULL(key, "Key");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
        return g_hash_table_lookup(BT_VALUE_TO_MAP(map_obj)->ght,
                GUINT_TO_POINTER(g_quark_from_string(key)));
 }
@@ -1061,9 +1066,9 @@ const struct bt_value *bt_value_map_borrow_entry_value_const(
 
 bt_bool bt_value_map_has_entry(const struct bt_value *map_obj, const char *key)
 {
-       BT_ASSERT_PRE_NON_NULL(map_obj, "Value object");
-       BT_ASSERT_PRE_NON_NULL(key, "Key");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
+       BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
+       BT_ASSERT_PRE_DEV_NON_NULL(key, "Key");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
        return bt_g_hash_table_contains(BT_VALUE_TO_MAP(map_obj)->ght,
                GUINT_TO_POINTER(g_quark_from_string(key)));
 }
@@ -1076,7 +1081,7 @@ enum bt_value_map_insert_entry_status bt_value_map_insert_entry(
        BT_ASSERT_PRE_NON_NULL(key, "Key");
        BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
        BT_ASSERT_PRE_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
-       BT_ASSERT_PRE_VALUE_HOT(map_obj, "Map value object");
+       BT_ASSERT_PRE_DEV_VALUE_HOT(map_obj, "Map value object");
        g_hash_table_insert(BT_VALUE_TO_MAP(map_obj)->ght,
                GUINT_TO_POINTER(g_quark_from_string(key)), element_obj);
        bt_object_get_ref(element_obj);
@@ -1190,9 +1195,9 @@ enum bt_value_map_foreach_entry_status bt_value_map_foreach_entry(
        GHashTableIter iter;
        struct bt_value_map *typed_map_obj = BT_VALUE_TO_MAP(map_obj);
 
-       BT_ASSERT_PRE_NON_NULL(map_obj, "Value object");
-       BT_ASSERT_PRE_NON_NULL(func, "Callback");
-       BT_ASSERT_PRE_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
+       BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
+       BT_ASSERT_PRE_DEV_NON_NULL(func, "Callback");
+       BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
        g_hash_table_iter_init(&iter, typed_map_obj->ght);
 
        while (g_hash_table_iter_next(&iter, &key, &element_obj)) {
@@ -1356,8 +1361,8 @@ bt_bool bt_value_compare(const struct bt_value *object_a,
 {
        bt_bool ret = BT_FALSE;
 
-       BT_ASSERT_PRE_NON_NULL(object_a, "Value object A");
-       BT_ASSERT_PRE_NON_NULL(object_b, "Value object B");
+       BT_ASSERT_PRE_DEV_NON_NULL(object_a, "Value object A");
+       BT_ASSERT_PRE_DEV_NON_NULL(object_b, "Value object B");
 
        if (object_a->type != object_b->type) {
                BT_LOGT("Values are different: type mismatch: "
This page took 0.102187 seconds and 4 git commands to generate.