configure: re-enable '-Wunused-parameter'
[babeltrace.git] / src / lib / trace-ir / stream-class.c
index 2fe47615ad340e54c1b2def294359efd4f0553eb..07c12afe7e5dddfef12aa2101c850e0b18fe95e5 100644 (file)
@@ -32,7 +32,8 @@
 #include "lib/func-status.h"
 
 #define BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(_sc)                                \
-       BT_ASSERT_PRE_DEV_HOT((_sc), "Stream class", ": %!+S", (_sc))
+       BT_ASSERT_PRE_DEV_HOT("stream-class", (_sc), "Stream class",    \
+               ": %!+S", (_sc))
 
 static
 void destroy_stream_class(struct bt_object *obj)
@@ -66,7 +67,7 @@ void destroy_stream_class(struct bt_object *obj)
 
 static
 void free_field_wrapper(struct bt_field_wrapper *field_wrapper,
-               struct bt_stream_class *stream_class)
+               struct bt_stream_class *stream_class __attribute__((unused)))
 {
        bt_field_wrapper_destroy((void *) field_wrapper);
 }
@@ -99,7 +100,8 @@ struct bt_stream_class *create_stream_class_with_id(
        int ret;
 
        BT_ASSERT(tc);
-       BT_ASSERT_PRE(stream_class_id_is_unique(tc, id),
+       BT_ASSERT_PRE("stream-class-id-is-unique",
+               stream_class_id_is_unique(tc, id),
                "Duplicate stream class ID: %![tc-]+T, id=%" PRIu64, tc, id);
        BT_LIB_LOGD("Creating stream class object: %![tc-]+T, id=%" PRIu64,
                tc, id);
@@ -159,28 +161,34 @@ end:
        return stream_class;
 }
 
+BT_EXPORT
 struct bt_stream_class *bt_stream_class_create(struct bt_trace_class *tc)
 {
        BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_TC_NON_NULL(tc);
-       BT_ASSERT_PRE(tc->assigns_automatic_stream_class_id,
+       BT_ASSERT_PRE("trace-class-automatically-assigns-stream-class-ids",
+               tc->assigns_automatic_stream_class_id,
                "Trace class does not automatically assigns stream class IDs: "
                "%![sc-]+T", tc);
        return create_stream_class_with_id(tc,
                (uint64_t) tc->stream_classes->len);
 }
 
+BT_EXPORT
 struct bt_stream_class *bt_stream_class_create_with_id(
                struct bt_trace_class *tc, uint64_t id)
 {
        BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_TC_NON_NULL(tc);
-       BT_ASSERT_PRE(!tc->assigns_automatic_stream_class_id,
+       BT_ASSERT_PRE(
+               "trace-class-does-not-automatically-assigns-stream-class-ids",
+               !tc->assigns_automatic_stream_class_id,
                "Trace class automatically assigns stream class IDs: "
                "%![sc-]+T", tc);
        return create_stream_class_with_id(tc, id);
 }
 
+BT_EXPORT
 struct bt_trace_class *bt_stream_class_borrow_trace_class(
                struct bt_stream_class *stream_class)
 {
@@ -188,18 +196,21 @@ struct bt_trace_class *bt_stream_class_borrow_trace_class(
        return bt_stream_class_borrow_trace_class_inline(stream_class);
 }
 
+BT_EXPORT
 const struct bt_trace_class *bt_stream_class_borrow_trace_class_const(
                const struct bt_stream_class *stream_class)
 {
        return bt_stream_class_borrow_trace_class((void *) stream_class);
 }
 
+BT_EXPORT
 const char *bt_stream_class_get_name(const struct bt_stream_class *stream_class)
 {
        BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
        return stream_class->name.value;
 }
 
+BT_EXPORT
 enum bt_stream_class_set_name_status bt_stream_class_set_name(
                struct bt_stream_class *stream_class,
                const char *name)
@@ -214,12 +225,14 @@ enum bt_stream_class_set_name_status bt_stream_class_set_name(
        return BT_FUNC_STATUS_OK;
 }
 
+BT_EXPORT
 uint64_t bt_stream_class_get_id(const struct bt_stream_class *stream_class)
 {
        BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
        return stream_class->id;
 }
 
+BT_EXPORT
 uint64_t bt_stream_class_get_event_class_count(
                const struct bt_stream_class *stream_class)
 {
@@ -227,6 +240,7 @@ uint64_t bt_stream_class_get_event_class_count(
        return (uint64_t) stream_class->event_classes->len;
 }
 
+BT_EXPORT
 struct bt_event_class *bt_stream_class_borrow_event_class_by_index(
                struct bt_stream_class *stream_class, uint64_t index)
 {
@@ -235,6 +249,7 @@ struct bt_event_class *bt_stream_class_borrow_event_class_by_index(
        return g_ptr_array_index(stream_class->event_classes, index);
 }
 
+BT_EXPORT
 const struct bt_event_class *
 bt_stream_class_borrow_event_class_by_index_const(
                const struct bt_stream_class *stream_class, uint64_t index)
@@ -243,6 +258,7 @@ bt_stream_class_borrow_event_class_by_index_const(
                (void *) stream_class, index);
 }
 
+BT_EXPORT
 struct bt_event_class *bt_stream_class_borrow_event_class_by_id(
                struct bt_stream_class *stream_class, uint64_t id)
 {
@@ -265,6 +281,7 @@ end:
        return event_class;
 }
 
+BT_EXPORT
 const struct bt_event_class *
 bt_stream_class_borrow_event_class_by_id_const(
                const struct bt_stream_class *stream_class, uint64_t id)
@@ -273,6 +290,7 @@ bt_stream_class_borrow_event_class_by_id_const(
                (void *) stream_class, id);
 }
 
+BT_EXPORT
 const struct bt_field_class *
 bt_stream_class_borrow_packet_context_field_class_const(
                const struct bt_stream_class *stream_class)
@@ -281,6 +299,7 @@ bt_stream_class_borrow_packet_context_field_class_const(
        return stream_class->packet_context_fc;
 }
 
+BT_EXPORT
 struct bt_field_class *
 bt_stream_class_borrow_packet_context_field_class(
                struct bt_stream_class *stream_class)
@@ -289,6 +308,7 @@ bt_stream_class_borrow_packet_context_field_class(
        return stream_class->packet_context_fc;
 }
 
+BT_EXPORT
 enum bt_stream_class_set_field_class_status
 bt_stream_class_set_packet_context_field_class(
                struct bt_stream_class *stream_class,
@@ -304,13 +324,15 @@ bt_stream_class_set_packet_context_field_class(
 
        BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_SC_NON_NULL(stream_class);
-       BT_ASSERT_PRE(stream_class->supports_packets,
+       BT_ASSERT_PRE("supports-packets",
+               stream_class->supports_packets,
                "Stream class does not support packets: %![sc-]+S",
                stream_class);
        BT_ASSERT_PRE_FC_NON_NULL(field_class);
        BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
-       BT_ASSERT_PRE_FC_IS_STRUCT(field_class, "Packet context field class");
-       ret = bt_resolve_field_paths(field_class, &resolve_ctx);
+       BT_ASSERT_PRE_FC_IS_STRUCT("field-class", field_class,
+               "Packet context field class");
+       ret = bt_resolve_field_paths(field_class, &resolve_ctx, __func__);
        if (ret) {
                /*
                 * This is the only reason for which
@@ -333,6 +355,7 @@ end:
        return ret;
 }
 
+BT_EXPORT
 const struct bt_field_class *
 bt_stream_class_borrow_event_common_context_field_class_const(
                const struct bt_stream_class *stream_class)
@@ -341,6 +364,7 @@ bt_stream_class_borrow_event_common_context_field_class_const(
        return stream_class->event_common_context_fc;
 }
 
+BT_EXPORT
 struct bt_field_class *
 bt_stream_class_borrow_event_common_context_field_class(
                struct bt_stream_class *stream_class)
@@ -349,6 +373,7 @@ bt_stream_class_borrow_event_common_context_field_class(
        return stream_class->event_common_context_fc;
 }
 
+BT_EXPORT
 enum bt_stream_class_set_field_class_status
 bt_stream_class_set_event_common_context_field_class(
                struct bt_stream_class *stream_class,
@@ -366,10 +391,10 @@ bt_stream_class_set_event_common_context_field_class(
        BT_ASSERT_PRE_SC_NON_NULL(stream_class);
        BT_ASSERT_PRE_FC_NON_NULL(field_class);
        BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
-       BT_ASSERT_PRE_FC_IS_STRUCT(field_class,
+       BT_ASSERT_PRE_FC_IS_STRUCT("field-class", field_class,
                "Event common context field class");
        resolve_ctx.packet_context = stream_class->packet_context_fc;
-       ret = bt_resolve_field_paths(field_class, &resolve_ctx);
+       ret = bt_resolve_field_paths(field_class, &resolve_ctx, __func__);
        if (ret) {
                /*
                 * This is the only reason for which
@@ -392,7 +417,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 void _bt_stream_class_freeze(const struct bt_stream_class *stream_class)
 {
        /* The field classes and default clock class are already frozen */
@@ -404,6 +428,7 @@ void _bt_stream_class_freeze(const struct bt_stream_class *stream_class)
        ((struct bt_stream_class *) stream_class)->frozen = true;
 }
 
+BT_EXPORT
 enum bt_stream_class_set_default_clock_class_status
 bt_stream_class_set_default_clock_class(
                struct bt_stream_class *stream_class,
@@ -422,6 +447,7 @@ bt_stream_class_set_default_clock_class(
        return BT_FUNC_STATUS_OK;
 }
 
+BT_EXPORT
 struct bt_clock_class *bt_stream_class_borrow_default_clock_class(
                struct bt_stream_class *stream_class)
 {
@@ -429,6 +455,7 @@ struct bt_clock_class *bt_stream_class_borrow_default_clock_class(
        return stream_class->default_clock_class;
 }
 
+BT_EXPORT
 const struct bt_clock_class *bt_stream_class_borrow_default_clock_class_const(
                const struct bt_stream_class *stream_class)
 {
@@ -436,6 +463,7 @@ const struct bt_clock_class *bt_stream_class_borrow_default_clock_class_const(
        return stream_class->default_clock_class;
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_assigns_automatic_event_class_id(
                const struct bt_stream_class *stream_class)
 {
@@ -443,6 +471,7 @@ bt_bool bt_stream_class_assigns_automatic_event_class_id(
        return (bt_bool) stream_class->assigns_automatic_event_class_id;
 }
 
+BT_EXPORT
 void bt_stream_class_set_assigns_automatic_event_class_id(
                struct bt_stream_class *stream_class,
                bt_bool value)
@@ -454,6 +483,7 @@ void bt_stream_class_set_assigns_automatic_event_class_id(
                "assignment property: %!+S", stream_class);
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_assigns_automatic_stream_id(
                const struct bt_stream_class *stream_class)
 {
@@ -461,6 +491,7 @@ bt_bool bt_stream_class_assigns_automatic_stream_id(
        return (bt_bool) stream_class->assigns_automatic_stream_id;
 }
 
+BT_EXPORT
 void bt_stream_class_set_supports_discarded_events(
                struct bt_stream_class *stream_class,
                bt_bool supports_discarded_events,
@@ -468,12 +499,14 @@ void bt_stream_class_set_supports_discarded_events(
 {
        BT_ASSERT_PRE_SC_NON_NULL(stream_class);
        BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
-       BT_ASSERT_PRE(supports_discarded_events ||
-               !with_default_clock_snapshots,
+       BT_ASSERT_PRE("supports-discarded-events-for-default-clock-snapshots",
+               supports_discarded_events ||
+                       !with_default_clock_snapshots,
                "Discarded events cannot have default clock snapshots when "
                "not supported: %!+S", stream_class);
-       BT_ASSERT_PRE(!with_default_clock_snapshots ||
-               stream_class->default_clock_class,
+       BT_ASSERT_PRE("has-default-clock-class-for-default-clock-snapshots",
+               !with_default_clock_snapshots ||
+                       stream_class->default_clock_class,
                "Stream class has no default clock class: %!+S", stream_class);
        stream_class->supports_discarded_events =
                (bool) supports_discarded_events;
@@ -483,6 +516,7 @@ void bt_stream_class_set_supports_discarded_events(
                "%!+S", stream_class);
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_supports_discarded_events(
                const struct bt_stream_class *stream_class)
 {
@@ -490,6 +524,7 @@ bt_bool bt_stream_class_supports_discarded_events(
        return (bt_bool) stream_class->supports_discarded_events;
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots(
                const struct bt_stream_class *stream_class)
 {
@@ -497,6 +532,7 @@ bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots(
        return (bt_bool) stream_class->discarded_events_have_default_clock_snapshots;
 }
 
+BT_EXPORT
 void bt_stream_class_set_supports_discarded_packets(
                struct bt_stream_class *stream_class,
                bt_bool supports_discarded_packets,
@@ -504,16 +540,19 @@ void bt_stream_class_set_supports_discarded_packets(
 {
        BT_ASSERT_PRE_SC_NON_NULL(stream_class);
        BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
-       BT_ASSERT_PRE(!supports_discarded_packets ||
-               stream_class->supports_packets,
+       BT_ASSERT_PRE("supports-packets-for-discarded-packets-support",
+               !supports_discarded_packets ||
+                       stream_class->supports_packets,
                "Stream class does not support packets: %!+S",
                stream_class);
-       BT_ASSERT_PRE(supports_discarded_packets ||
-               !with_default_clock_snapshots,
+       BT_ASSERT_PRE("supports-discarded-packets-for-default-clock-snapshots",
+               supports_discarded_packets ||
+                       !with_default_clock_snapshots,
                "Discarded packets cannot have default clock snapshots when "
                "not supported: %!+S", stream_class);
-       BT_ASSERT_PRE(!with_default_clock_snapshots ||
-               stream_class->default_clock_class,
+       BT_ASSERT_PRE("has-default-clock-class-for-default-clock-snapshots",
+               !with_default_clock_snapshots ||
+                       stream_class->default_clock_class,
                "Stream class has no default clock class: %!+S", stream_class);
        stream_class->supports_discarded_packets =
                (bool) supports_discarded_packets;
@@ -523,6 +562,7 @@ void bt_stream_class_set_supports_discarded_packets(
                "%!+S", stream_class);
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_supports_discarded_packets(
                const struct bt_stream_class *stream_class)
 {
@@ -530,6 +570,7 @@ bt_bool bt_stream_class_supports_discarded_packets(
        return (bt_bool) stream_class->supports_discarded_packets;
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots(
                const struct bt_stream_class *stream_class)
 {
@@ -537,6 +578,7 @@ bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots(
        return (bt_bool) stream_class->discarded_packets_have_default_clock_snapshots;
 }
 
+BT_EXPORT
 void bt_stream_class_set_supports_packets(
                struct bt_stream_class *stream_class,
                bt_bool supports_packets,
@@ -548,18 +590,21 @@ void bt_stream_class_set_supports_packets(
                with_end_default_clock_snapshot;
        BT_ASSERT_PRE_SC_NON_NULL(stream_class);
        BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
-       BT_ASSERT_PRE(supports_packets ||
-               !with_default_clock_snapshot,
+       BT_ASSERT_PRE("supports-packets-for-default-clock-snapshot",
+               supports_packets ||
+                       !with_default_clock_snapshot,
                "Packets cannot have default clock snapshots when "
                "not supported: %!+S", stream_class);
-       BT_ASSERT_PRE(!with_default_clock_snapshot ||
-               stream_class->default_clock_class,
+       BT_ASSERT_PRE("has-default-clock-class-for-default-clock-snapshot",
+               !with_default_clock_snapshot ||
+                       stream_class->default_clock_class,
                "Stream class has no default clock class: %!+S", stream_class);
-       BT_ASSERT_PRE(supports_packets || !stream_class->packet_context_fc,
+       BT_ASSERT_PRE("supports-packets-for-packet-context-field-class",
+               supports_packets || !stream_class->packet_context_fc,
                "Stream class already has a packet context field class: %!+S",
                stream_class);
-       BT_ASSERT_PRE(supports_packets ||
-               !stream_class->supports_discarded_packets,
+       BT_ASSERT_PRE("supports-packets-for-discarded-packets-support",
+               supports_packets || !stream_class->supports_discarded_packets,
                "Stream class already supports discarded packets: %!+S",
                stream_class);
        stream_class->supports_packets = (bool) supports_packets;
@@ -571,6 +616,7 @@ void bt_stream_class_set_supports_packets(
                stream_class);
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_supports_packets(
                const struct bt_stream_class *stream_class)
 {
@@ -578,6 +624,7 @@ bt_bool bt_stream_class_supports_packets(
        return (bt_bool) stream_class->supports_packets;
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot(
                const struct bt_stream_class *stream_class)
 {
@@ -585,6 +632,7 @@ bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot(
        return (bt_bool) stream_class->packets_have_beginning_default_clock_snapshot;
 }
 
+BT_EXPORT
 bt_bool bt_stream_class_packets_have_end_default_clock_snapshot(
                const struct bt_stream_class *stream_class)
 {
@@ -592,6 +640,7 @@ bt_bool bt_stream_class_packets_have_end_default_clock_snapshot(
        return (bt_bool) stream_class->packets_have_end_default_clock_snapshot;
 }
 
+BT_EXPORT
 void bt_stream_class_set_assigns_automatic_stream_id(
                struct bt_stream_class *stream_class,
                bt_bool value)
@@ -603,6 +652,7 @@ void bt_stream_class_set_assigns_automatic_stream_id(
                "assignment property: %!+S", stream_class);
 }
 
+BT_EXPORT
 const struct bt_value *bt_stream_class_borrow_user_attributes_const(
                const struct bt_stream_class *stream_class)
 {
@@ -610,6 +660,7 @@ const struct bt_value *bt_stream_class_borrow_user_attributes_const(
        return stream_class->user_attributes;
 }
 
+BT_EXPORT
 struct bt_value *bt_stream_class_borrow_user_attributes(
                struct bt_stream_class *stream_class)
 {
@@ -617,6 +668,7 @@ struct bt_value *bt_stream_class_borrow_user_attributes(
                (void *) stream_class);
 }
 
+BT_EXPORT
 void bt_stream_class_set_user_attributes(
                struct bt_stream_class *stream_class,
                const struct bt_value *user_attributes)
@@ -630,11 +682,13 @@ void bt_stream_class_set_user_attributes(
        bt_object_get_ref_no_null_check(stream_class->user_attributes);
 }
 
+BT_EXPORT
 void bt_stream_class_get_ref(const struct bt_stream_class *stream_class)
 {
        bt_object_get_ref(stream_class);
 }
 
+BT_EXPORT
 void bt_stream_class_put_ref(const struct bt_stream_class *stream_class)
 {
        bt_object_put_ref(stream_class);
This page took 0.044614 seconds and 4 git commands to generate.