lib: remove clock class priority map, use default clock value
[babeltrace.git] / lib / lib-logging.c
index 214c2e3ae2c36f91ce357fcf4adf1b4d054ed861..b8ab574580ec5234e76ebca274bfbf6bc369c1ae 100644 (file)
@@ -32,7 +32,6 @@
 #include <glib.h>
 #include <babeltrace/common-internal.h>
 #include <babeltrace/lib-logging-internal.h>
-#include <babeltrace/ref-internal.h>
 #include <babeltrace/values-internal.h>
 #include <babeltrace/object-pool-internal.h>
 #include <babeltrace/ctf-ir/field-types-internal.h>
@@ -55,7 +54,6 @@
 #include <babeltrace/ctf-writer/trace-internal.h>
 #include <babeltrace/ctf-writer/clock-internal.h>
 #include <babeltrace/ctf-writer/writer-internal.h>
-#include <babeltrace/graph/clock-class-priority-map-internal.h>
 #include <babeltrace/graph/component-class-internal.h>
 #include <babeltrace/graph/component-class-sink-colander-internal.h>
 #include <babeltrace/graph/component-filter-internal.h>
@@ -64,9 +62,7 @@
 #include <babeltrace/graph/component-source-internal.h>
 #include <babeltrace/graph/connection-internal.h>
 #include <babeltrace/graph/graph-internal.h>
-#include <babeltrace/graph/notification-discarded-elements-internal.h>
 #include <babeltrace/graph/notification-event-internal.h>
-#include <babeltrace/graph/notification-heap-internal.h>
 #include <babeltrace/graph/notification-inactivity-internal.h>
 #include <babeltrace/graph/notification-internal.h>
 #include <babeltrace/graph/notification-iterator-internal.h>
@@ -132,10 +128,31 @@ static inline void format_port(char **buf_ch, bool extended,
 static inline void format_connection(char **buf_ch, bool extended,
                const char *prefix, struct bt_connection *connection);
 
-static inline void format_ref_count(char **buf_ch, bool extended,
+static inline void format_clock_value(char **buf_ch, bool extended,
+               const char *prefix, struct bt_clock_value *clock_value);
+
+static inline void format_object(char **buf_ch, bool extended,
                const char *prefix, struct bt_object *obj)
 {
-       BUF_APPEND(", %sref-count=%lu", prefix, obj->ref_count.count);
+       BUF_APPEND(", %sref-count=%llu", prefix, obj->ref_count);
+}
+
+static inline void format_clock_value_set(char **buf_ch, bool extended,
+               const char *prefix, struct bt_clock_value_set *cv_set)
+{
+       char tmp_prefix[64];
+
+       if (!cv_set->clock_values) {
+               return;
+       }
+
+       BUF_APPEND(", %ssize=%u", PRFIELD(cv_set->clock_values->len));
+
+       if (cv_set->default_cv) {
+               SET_TMP_PREFIX("default-cv-");
+               format_clock_value(buf_ch, extended, tmp_prefix,
+                       cv_set->default_cv);
+       }
 }
 
 static inline void format_object_pool(char **buf_ch, bool extended,
@@ -335,10 +352,10 @@ static inline void format_field_common(char **buf_ch, bool extended,
                struct bt_field_common_string *str =
                        BT_FROM_COMMON(field);
 
-               if (str->payload) {
-                       BT_ASSERT(str->payload);
+               if (str->buf) {
+                       BT_ASSERT(str->buf->data);
                        BUF_APPEND(", %spartial-value=\"%.32s\"",
-                               PRFIELD(str->payload->str));
+                               PRFIELD(str->buf->data));
 
                }
                break;
@@ -586,6 +603,9 @@ static inline void format_stream_class(char **buf_ch, bool extended,
        SET_TMP_PREFIX("ehf-pool-");
        format_object_pool(buf_ch, extended, prefix,
                &stream_class->event_header_field_pool);
+       SET_TMP_PREFIX("pcf-pool-");
+       format_object_pool(buf_ch, extended, prefix,
+               &stream_class->packet_context_field_pool);
 }
 
 static inline void format_writer_stream_class(char **buf_ch, bool extended,
@@ -711,7 +731,7 @@ static inline void format_stream_common(char **buf_ch, bool extended,
                return;
        }
 
-       trace = (void *) bt_object_borrow_parent(stream);
+       trace = (void *) bt_object_borrow_parent(&stream->base);
        if (!trace) {
                return;
        }
@@ -806,7 +826,7 @@ static inline void format_packet(char **buf_ch, bool extended,
        BUF_APPEND(", %sstream-addr=%p", PRFIELD(stream));
        SET_TMP_PREFIX("stream-");
        format_stream(buf_ch, false, tmp_prefix, stream);
-       trace = (struct bt_trace *) bt_object_borrow_parent(stream);
+       trace = (struct bt_trace *) bt_object_borrow_parent(&stream->common.base);
        if (!trace) {
                return;
        }
@@ -877,11 +897,8 @@ static inline void format_event(char **buf_ch, bool extended,
                return;
        }
 
-       if (event->clock_values) {
-               BUF_APPEND(", %sclock-value-count=%u",
-                       PRFIELD(g_hash_table_size(event->clock_values)));
-       }
-
+       SET_TMP_PREFIX("cvs-");
+       format_clock_value_set(buf_ch, extended, tmp_prefix, &event->cv_set);
        packet = bt_event_borrow_packet(event);
        if (!packet) {
                return;
@@ -946,7 +963,7 @@ static inline void format_clock_value(char **buf_ch, bool extended,
                const char *prefix, struct bt_clock_value *clock_value)
 {
        char tmp_prefix[64];
-       BUF_APPEND(", %svalue=%" PRIu64 ", %sns-from-epoch=%" PRId64,
+       BUF_APPEND(", %sraw-value=%" PRIu64 ", %sns-from-epoch=%" PRId64,
                PRFIELD(clock_value->value),
                PRFIELD(clock_value->ns_from_epoch));
 
@@ -1038,7 +1055,8 @@ static inline void format_notification(char **buf_ch, bool extended,
                return;
        }
 
-       BUF_APPEND(", %sis-frozen=%d", PRFIELD(notif->frozen));
+       BUF_APPEND(", %sis-frozen=%d, %sgraph-addr=%p",
+               PRFIELD(notif->frozen), PRFIELD(notif->graph));
 
        switch (notif->type) {
        case BT_NOTIFICATION_TYPE_EVENT:
@@ -1047,28 +1065,6 @@ static inline void format_notification(char **buf_ch, bool extended,
 
                SET_TMP_PREFIX("event-");
                format_event(buf_ch, true, tmp_prefix, notif_event->event);
-
-               if (!notif_event->cc_prio_map) {
-                       return;
-               }
-
-               BUF_APPEND(", %scc-prio-map-addr=%p, %scc-prio-map-cc-count=%u",
-                       PRFIELD(notif_event->cc_prio_map),
-                       PRFIELD(notif_event->cc_prio_map->entries->len));
-               break;
-       }
-       case BT_NOTIFICATION_TYPE_INACTIVITY:
-       {
-               struct bt_notification_inactivity *notif_inactivity =
-                       (void *) notif;
-
-               if (!notif_inactivity->cc_prio_map) {
-                       return;
-               }
-
-               BUF_APPEND(", %scc-prio-map-addr=%p, %scc-prio-map-cc-count=%u",
-                       PRFIELD(notif_inactivity->cc_prio_map),
-                       PRFIELD(notif_inactivity->cc_prio_map->entries->len));
                break;
        }
        case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
@@ -1107,28 +1103,6 @@ static inline void format_notification(char **buf_ch, bool extended,
                format_packet(buf_ch, true, tmp_prefix, notif_packet->packet);
                break;
        }
-       case BT_NOTIFICATION_TYPE_DISCARDED_EVENTS:
-       case BT_NOTIFICATION_TYPE_DISCARDED_PACKETS:
-       {
-               struct bt_notification_discarded_elements *notif_discarded =
-                       (void *) notif;
-
-               BUF_APPEND(", %scount=%" PRId64,
-                       PRFIELD(notif_discarded->count));
-
-               if (notif_discarded->begin_clock_value) {
-                       SET_TMP_PREFIX("begin-clock-value-");
-                       format_clock_value(buf_ch, true, tmp_prefix,
-                               notif_discarded->begin_clock_value);
-               }
-
-               if (notif_discarded->end_clock_value) {
-                       SET_TMP_PREFIX("end-clock-value-");
-                       format_clock_value(buf_ch, true, tmp_prefix,
-                               notif_discarded->end_clock_value);
-               }
-               break;
-       }
        default:
                break;
        }
@@ -1240,6 +1214,8 @@ static inline void format_connection(char **buf_ch, bool extended,
 static inline void format_graph(char **buf_ch, bool extended,
                const char *prefix, struct bt_graph *graph)
 {
+       char tmp_prefix[64];
+
        BUF_APPEND(", %sis-canceled=%d", PRFIELD(graph->canceled));
 
        if (!extended) {
@@ -1255,6 +1231,16 @@ static inline void format_graph(char **buf_ch, bool extended,
                BUF_APPEND(", %sconn-count=%u",
                        PRFIELD(graph->connections->len));
        }
+
+       SET_TMP_PREFIX("en-pool-");
+       format_object_pool(buf_ch, extended, prefix,
+               &graph->event_notif_pool);
+       SET_TMP_PREFIX("pbn-pool-");
+       format_object_pool(buf_ch, extended, prefix,
+               &graph->packet_begin_notif_pool);
+       SET_TMP_PREFIX("pen-pool-");
+       format_object_pool(buf_ch, extended, prefix,
+               &graph->packet_end_notif_pool);
 }
 
 static inline void format_notification_iterator(char **buf_ch,
@@ -1310,9 +1296,6 @@ static inline void format_notification_iterator(char **buf_ch,
                SET_TMP_PREFIX("colander-comp-");
                format_component(buf_ch, false, tmp_prefix,
                        iter_output_port->colander);
-               SET_TMP_PREFIX("output-port-");
-               format_port(buf_ch, false, tmp_prefix,
-                       iter_output_port->output_port);
                break;
        }
        default:
@@ -1477,9 +1460,6 @@ static inline void handle_conversion_specifier_bt(void *priv_data,
        switch (cat) {
        case CAT_DEFAULT:
                switch (*fmt_ch) {
-               case 'r':
-                       format_ref_count(buf_ch, extended, prefix, obj);
-                       break;
                case 'F':
                        format_field_type(buf_ch, extended, prefix, obj);
                        break;
@@ -1543,6 +1523,9 @@ static inline void handle_conversion_specifier_bt(void *priv_data,
                case 'o':
                        format_object_pool(buf_ch, extended, prefix, obj);
                        break;
+               case 'O':
+                       format_object(buf_ch, extended, prefix, obj);
+                       break;
                default:
                        abort();
                }
This page took 0.026678 seconds and 4 git commands to generate.