lib: remove clock class priority map, use default clock value
[babeltrace.git] / lib / lib-logging.c
index 674546011f799d253e0e156f98e9848c8e6f7fab..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,7 +62,6 @@
 #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-inactivity-internal.h>
 #include <babeltrace/graph/notification-internal.h>
@@ -131,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,
@@ -713,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;
        }
@@ -808,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;
        }
@@ -879,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;
@@ -948,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));
 
@@ -1050,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:
@@ -1110,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;
        }
@@ -1489,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;
@@ -1555,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.031255 seconds and 4 git commands to generate.