lib: add sink component class's "graph is configured" method
[babeltrace.git] / lib / lib-logging.c
index 0872cc26bbc9af334654026e83e292cf5e95c3c8..3fd96dd1ac401ecc2e55931d67b6bb1d340ef88f 100644 (file)
@@ -531,7 +531,7 @@ static inline void format_stream_class(char **buf_ch, bool extended,
        SET_TMP_PREFIX("trace-class-");
        format_trace_class(buf_ch, false, tmp_prefix, trace_class);
        SET_TMP_PREFIX("pcf-pool-");
-       format_object_pool(buf_ch, extended, prefix,
+       format_object_pool(buf_ch, extended, tmp_prefix,
                &stream_class->packet_context_field_pool);
 }
 
@@ -587,7 +587,8 @@ static inline void format_event_class(char **buf_ch, bool extended,
        SET_TMP_PREFIX("trace-class-");
        format_trace_class(buf_ch, false, tmp_prefix, trace_class);
        SET_TMP_PREFIX("event-pool-");
-       format_object_pool(buf_ch, extended, prefix, &event_class->event_pool);
+       format_object_pool(buf_ch, extended, tmp_prefix,
+               &event_class->event_pool);
 }
 
 static inline void format_stream(char **buf_ch, bool extended,
@@ -630,7 +631,7 @@ static inline void format_stream(char **buf_ch, bool extended,
        }
 
        SET_TMP_PREFIX("packet-pool-");
-       format_object_pool(buf_ch, extended, prefix, &stream->packet_pool);
+       format_object_pool(buf_ch, extended, tmp_prefix, &stream->packet_pool);
 }
 
 static inline void format_packet(char **buf_ch, bool extended,
@@ -712,12 +713,6 @@ static inline void format_event(char **buf_ch, bool extended,
                }
        }
 
-       if (event->default_cs) {
-               SET_TMP_PREFIX("default-cs-");
-               format_clock_snapshot(buf_ch, true, tmp_prefix,
-                       event->default_cs);
-       }
-
        packet = bt_event_borrow_packet_const(event);
        if (!packet) {
                return;
@@ -762,16 +757,17 @@ static inline void format_clock_class(char **buf_ch, bool extended,
 
        BUF_APPEND(", %sis-frozen=%d, %sprecision=%" PRIu64 ", "
                "%soffset-s=%" PRId64 ", "
-               "%soffset-cycles=%" PRIu64 ", %sis-absolute=%d, "
+               "%soffset-cycles=%" PRIu64 ", %sorigin-is-unix-epoch=%d, "
                "%sbase-offset-ns=%" PRId64,
                PRFIELD(clock_class->frozen), PRFIELD(clock_class->precision),
                PRFIELD(clock_class->offset_seconds),
                PRFIELD(clock_class->offset_cycles),
-               PRFIELD(clock_class->is_absolute),
+               PRFIELD(clock_class->origin_is_unix_epoch),
                PRFIELD(clock_class->base_offset.value_ns));
 
        SET_TMP_PREFIX("cs-pool-");
-       format_object_pool(buf_ch, extended, prefix, &clock_class->cs_pool);
+       format_object_pool(buf_ch, extended, tmp_prefix,
+               &clock_class->cs_pool);
 }
 
 static inline void format_clock_snapshot(char **buf_ch, bool extended,
@@ -884,6 +880,12 @@ static inline void format_message(char **buf_ch, bool extended,
                                msg_event->event);
                }
 
+               if (msg_event->default_cs) {
+                       SET_TMP_PREFIX("default-cs-");
+                       format_clock_snapshot(buf_ch, true, tmp_prefix,
+                               msg_event->default_cs);
+               }
+
                break;
        }
        case BT_MESSAGE_TYPE_STREAM_BEGINNING:
@@ -934,6 +936,12 @@ static inline void format_message(char **buf_ch, bool extended,
                                msg_packet->packet);
                }
 
+               if (msg_packet->default_cs) {
+                       SET_TMP_PREFIX("default-cs-");
+                       format_clock_snapshot(buf_ch, true, tmp_prefix,
+                               msg_packet->default_cs);
+               }
+
                break;
        }
        case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
@@ -1086,7 +1094,11 @@ static inline void format_graph(char **buf_ch, bool extended,
 {
        char tmp_prefix[64];
 
-       BUF_APPEND(", %sis-canceled=%d", PRFIELD(graph->canceled));
+       BUF_APPEND(", %sis-canceled=%d, %scan-consume=%d, "
+               "%sconfig-state=%s",
+               PRFIELD(graph->canceled),
+               PRFIELD(graph->can_consume),
+               PRFIELD(bt_graph_configuration_state_string(graph->config_state)));
 
        if (!extended) {
                return;
@@ -1103,13 +1115,13 @@ static inline void format_graph(char **buf_ch, bool extended,
        }
 
        SET_TMP_PREFIX("en-pool-");
-       format_object_pool(buf_ch, extended, prefix,
+       format_object_pool(buf_ch, extended, tmp_prefix,
                &graph->event_msg_pool);
        SET_TMP_PREFIX("pbn-pool-");
-       format_object_pool(buf_ch, extended, prefix,
+       format_object_pool(buf_ch, extended, tmp_prefix,
                &graph->packet_begin_msg_pool);
        SET_TMP_PREFIX("pen-pool-");
-       format_object_pool(buf_ch, extended, prefix,
+       format_object_pool(buf_ch, extended, tmp_prefix,
                &graph->packet_end_msg_pool);
 }
 
This page took 0.028902 seconds and 4 git commands to generate.