/* From clock-snapshot-const.h */
-typedef enum bt_clock_snapshot_state {
- BT_CLOCK_SNAPSHOT_STATE_KNOWN,
- BT_CLOCK_SNAPSHOT_STATE_UNKNOWN,
-} bt_clock_snapshot_state;
-
typedef enum bt_clock_snapshot_status {
BT_CLOCK_SNAPSHOT_STATUS_OK = 0,
BT_CLOCK_SNAPSHOT_STATUS_OVERFLOW = -75,
* THE SOFTWARE.
*/
-
-/* Output argument typemap for clock value output (always appends) */
-%typemap(in, numinputs=0)
- (const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT)
- (bt_clock_snapshot *temp_clock_snapshot = NULL) {
- $1 = &temp_clock_snapshot;
-}
-
-%typemap(argout)
- (const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT) {
- if (*$1) {
- /* SWIG_Python_AppendOutput() steals the created object */
- $result = SWIG_Python_AppendOutput($result,
- SWIG_NewPointerObj(SWIG_as_voidptr(*$1),
- SWIGTYPE_p_bt_clock_snapshot, 0));
- } else {
- /* SWIG_Python_AppendOutput() steals Py_None */
- Py_INCREF(Py_None);
- $result = SWIG_Python_AppendOutput($result, Py_None);
- }
-}
-
/* From message-const.h */
typedef enum bt_message_type {
extern const bt_event *bt_message_event_borrow_event_const(
const bt_message *message);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_event_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_event_borrow_stream_class_default_clock_class_const(
/* From message-message-iterator-inactivity-const.h */
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
+ const bt_message *msg);
/* From message-message-iterator-inactivity.h */
extern const bt_packet *bt_message_packet_beginning_borrow_packet_const(
const bt_message *message);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
extern const bt_packet *bt_message_packet_end_borrow_packet_const(
const bt_message *message);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_packet_end_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_packet_end_borrow_stream_class_default_clock_class_const(
/* From message-discarded-events-const.h */
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
+ const bt_message *msg);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_discarded_events_borrow_stream_class_default_clock_class_const(
/* From message-discarded-packets-const.h */
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
+ const bt_message *msg);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(
bt_stream_class_borrow_default_clock_class_const(
const bt_stream_class *stream_class);
-extern bt_bool bt_stream_class_default_clock_is_always_known(
- const bt_stream_class *stream_class);
-
extern void bt_stream_class_get_ref(const bt_stream_class *stream_class);
extern void bt_stream_class_put_ref(const bt_stream_class *stream_class);
/* For bt_message, bt_clock_snapshot, bt_stream */
#include <babeltrace/types.h>
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
#ifdef __cplusplus
extern "C" {
#endif
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot);
+ const bt_message *msg);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_discarded_events_borrow_stream_class_default_clock_class_const(
/* For bt_message, bt_clock_snapshot, bt_stream */
#include <babeltrace/types.h>
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
#ifdef __cplusplus
extern "C" {
#endif
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot);
+ const bt_message *msg);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(
/* For bt_bool, bt_message, bt_event. bt_clock_class, bt_clock_snapshot */
#include <babeltrace/types.h>
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
#ifdef __cplusplus
extern "C" {
#endif
extern const bt_event *bt_message_event_borrow_event_const(
const bt_message *message);
-extern bt_clock_snapshot_state
-bt_message_event_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot);
+extern const bt_clock_snapshot *
+bt_message_event_borrow_default_clock_snapshot_const(const bt_message *msg);
extern const bt_clock_class *
bt_message_event_borrow_stream_class_default_clock_class_const(
/* For bt_message, bt_clock_snapshot */
#include <babeltrace/types.h>
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
#ifdef __cplusplus
extern "C" {
#endif
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot);
+ const bt_message *msg);
#ifdef __cplusplus
}
/* For bt_message, bt_packet, bt_clock_snapshot, bt_clock_class */
#include <babeltrace/types.h>
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
#ifdef __cplusplus
extern "C" {
#endif
extern const bt_packet *bt_message_packet_beginning_borrow_packet_const(
const bt_message *message);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
/* For bt_message, bt_packet, bt_clock_snapshot, bt_clock_class */
#include <babeltrace/types.h>
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
#ifdef __cplusplus
extern "C" {
#endif
extern const bt_packet *bt_message_packet_end_borrow_packet_const(
const bt_message *message);
-extern bt_clock_snapshot_state
+extern const bt_clock_snapshot *
bt_message_packet_end_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot);
+ const bt_message *msg);
extern const bt_clock_class *
bt_message_packet_end_borrow_stream_class_default_clock_class_const(
/* For bt_message, bt_clock_snapshot, bt_stream */
#include <babeltrace/types.h>
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
#ifdef __cplusplus
extern "C" {
#endif
/* For bt_message, bt_clock_snapshot, bt_stream */
#include <babeltrace/types.h>
-/* For bt_clock_snapshot_state */
-#include <babeltrace/trace-ir/clock-snapshot-const.h>
-
#ifdef __cplusplus
extern "C" {
#endif
extern "C" {
#endif
-typedef enum bt_clock_snapshot_state {
- BT_CLOCK_SNAPSHOT_STATE_KNOWN,
- BT_CLOCK_SNAPSHOT_STATE_UNKNOWN,
-} bt_clock_snapshot_state;
-
typedef enum bt_clock_snapshot_status {
BT_CLOCK_SNAPSHOT_STATUS_OK = 0,
BT_CLOCK_SNAPSHOT_STATUS_OVERFLOW = -75,
bt_stream_class_borrow_default_clock_class_const(
const bt_stream_class *stream_class);
-extern bt_bool bt_stream_class_default_clock_is_always_known(
- const bt_stream_class *stream_class);
-
extern void bt_stream_class_get_ref(const bt_stream_class *stream_class);
extern void bt_stream_class_put_ref(const bt_stream_class *stream_class);
}
static inline
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
borrow_discarded_items_message_default_beginning_clock_snapshot_const(
- const struct bt_message *message,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *message)
{
struct bt_message_discarded_items *disc_items_msg = (void *) message;
"Message's stream's class has no default clock class: "
"%![msg-]+n, %![sc-]+S",
message, disc_items_msg->stream->class);
- BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)");
- *snapshot = disc_items_msg->default_begin_cs;
- return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
+ return disc_items_msg->default_begin_cs;
}
static inline
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
borrow_discarded_items_message_default_end_clock_snapshot_const(
- const struct bt_message *message,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *message)
{
struct bt_message_discarded_items *disc_items_msg = (void *) message;
"Message's stream's class has no default clock class: "
"%![msg-]+n, %![sc-]+S",
message, disc_items_msg->stream->class);
- BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)");
- *snapshot = disc_items_msg->default_end_cs;
- return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
+ return disc_items_msg->default_end_cs;
}
struct bt_message *bt_message_discarded_events_create(
set_discarded_items_message_count(message, count);
}
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- const struct bt_message *msg,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *msg)
{
BT_ASSERT_PRE_NON_NULL(msg, "Message");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_default_beginning_clock_snapshot_const(
- msg, snapshot);
+ msg);
}
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
- const struct bt_message *msg,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *msg)
{
BT_ASSERT_PRE_NON_NULL(msg, "Message");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_EVENTS);
return borrow_discarded_items_message_default_end_clock_snapshot_const(
- msg, snapshot);
+ msg);
}
const struct bt_stream *
set_discarded_items_message_count(message, count);
}
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- const struct bt_message *msg,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *msg)
{
BT_ASSERT_PRE_NON_NULL(msg, "Message");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_default_beginning_clock_snapshot_const(
- msg, snapshot);
+ msg);
}
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
- const struct bt_message *msg,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *msg)
{
BT_ASSERT_PRE_NON_NULL(msg, "Message");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_DISCARDED_PACKETS);
return borrow_discarded_items_message_default_end_clock_snapshot_const(
- msg, snapshot);
+ msg);
}
const struct bt_stream *
return borrow_event((void *) message);
}
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
bt_message_event_borrow_default_clock_snapshot_const(
- const struct bt_message *msg,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *msg)
{
struct bt_message_event *event_msg = (void *) msg;
struct bt_stream_class *stream_class;
BT_ASSERT_PRE(stream_class->default_clock_class,
"Message's stream's class has no default clock class: "
"%![msg-]+n, %![sc-]+S", msg, stream_class);
- BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)");
- *snapshot = event_msg->default_cs;
- return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
+ return event_msg->default_cs;
}
const bt_clock_class *
return (void *) ret_msg;
}
-extern enum bt_clock_snapshot_state
+extern const struct bt_clock_snapshot *
bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
- const bt_message *msg, const bt_clock_snapshot **snapshot)
+ const bt_message *msg)
{
struct bt_message_message_iterator_inactivity *inactivity = (void *) msg;
BT_ASSERT_PRE_NON_NULL(msg, "Message");
- BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY);
- *snapshot = inactivity->default_cs;
- return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
+ return inactivity->default_cs;
}
}
static inline
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
borrow_packet_message_default_clock_snapshot_const(
- const struct bt_message *message,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *message)
{
struct bt_message_packet *packet_msg = (void *) message;
"Message's stream's class has no default clock class: "
"%![msg-]+n, %![sc-]+S",
message, packet_msg->packet->stream->class);
- BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)");
- *snapshot = packet_msg->default_cs;
- return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
+ return packet_msg->default_cs;
}
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- const struct bt_message *msg,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *msg)
{
BT_ASSERT_PRE_NON_NULL(msg, "Message");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
- return borrow_packet_message_default_clock_snapshot_const(
- msg, snapshot);
+ return borrow_packet_message_default_clock_snapshot_const(msg);
}
-enum bt_clock_snapshot_state
+const struct bt_clock_snapshot *
bt_message_packet_end_borrow_default_clock_snapshot_const(
- const struct bt_message *msg,
- const struct bt_clock_snapshot **snapshot)
+ const struct bt_message *msg)
{
BT_ASSERT_PRE_NON_NULL(msg, "Message");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
- return borrow_packet_message_default_clock_snapshot_const(
- msg, snapshot);
+ return borrow_packet_message_default_clock_snapshot_const(msg);
}
static inline
"assignment property: %!+S", stream_class);
}
-bt_bool bt_stream_class_default_clock_is_always_known(
- const struct bt_stream_class *stream_class)
-{
- /* BT_CLOCK_SNAPSHOT_STATE_UNKNOWN is not supported as of 2.0 */
- return BT_TRUE;
-}
-
void bt_stream_class_get_ref(const struct bt_stream_class *stream_class)
{
bt_object_get_ref(stream_class);
BT_ASSERT(ec);
if (stream->sc->default_clock_class) {
- (void) bt_message_event_borrow_default_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_event_borrow_default_clock_snapshot_const(
+ msg);
}
ret = fs_sink_stream_write_event(stream, cs, ir_event, ec);
}
if (stream->sc->default_clock_class) {
- (void) bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
}
}
if (stream->sc->default_clock_class) {
- (void) bt_message_packet_end_borrow_default_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_packet_end_borrow_default_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
}
if (stream->sc->default_clock_class) {
- (void) bt_message_packet_end_borrow_default_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_packet_end_borrow_default_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
}
* The clock snapshot values will be validated when
* handling the next "packet beginning" message.
*/
- (void) bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
stream->discarded_events_state.beginning_cs =
bt_clock_snapshot_get_value(cs);
- cs = NULL;
- (void) bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
stream->discarded_events_state.end_cs =
bt_clock_snapshot_get_value(cs);
* The clock snapshot values will be validated when
* handling the next "packet beginning" message.
*/
- (void) bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
stream->discarded_packets_state.beginning_cs =
bt_clock_snapshot_get_value(cs);
- cs = NULL;
- (void) bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
- msg, &cs);
+ cs = bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
+ msg);
BT_ASSERT(cs);
stream->discarded_packets_state.end_cs =
bt_clock_snapshot_get_value(cs);
const char *name = bt_clock_class_get_name(
(*out_sc)->default_clock_class);
- if (!bt_stream_class_default_clock_is_always_known(ir_sc)) {
- BT_LOGE("Unsupported stream clock which can have an unknown value: "
- "sc-name=\"%s\"",
- bt_stream_class_get_name(ir_sc));
- goto error;
- }
-
if (name) {
/* Try original name, protected */
g_string_assign((*out_sc)->default_clock_class_name,
const bt_clock_class *clock_class = NULL;
const bt_clock_snapshot *clock_snapshot = NULL;
int ret = 0;
- bt_clock_snapshot_state cs_state = BT_CLOCK_SNAPSHOT_STATE_KNOWN;
bt_message_stream_activity_clock_snapshot_state sa_cs_state;
BT_ASSERT(msg);
msg);
BT_ASSERT(clock_class);
- cs_state = bt_message_event_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_event_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_PACKET_BEGINNING:
clock_class =
msg);
BT_ASSERT(clock_class);
- cs_state = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_PACKET_END:
clock_class =
msg);
BT_ASSERT(clock_class);
- cs_state = bt_message_packet_end_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_packet_end_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
clock_class =
msg);
BT_ASSERT(clock_class);
- cs_state = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_DISCARDED_PACKETS:
clock_class =
msg);
BT_ASSERT(clock_class);
- cs_state = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING:
clock_class =
break;
case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY:
- cs_state =
+ clock_snapshot =
bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ msg);
break;
default:
/* All the other messages have a higher priority */
goto end;
}
- if (cs_state != BT_CLOCK_SNAPSHOT_STATE_KNOWN) {
- BT_LOGE_STR("Unsupported unknown clock snapshot.");
- ret = -1;
- goto end;
- }
-
clock_class = bt_clock_snapshot_borrow_clock_class_const(clock_snapshot);
BT_ASSERT(clock_class);
const bt_clock_snapshot *cs;
const bt_clock_class *default_cc;
const bt_packet *in_packet;
- bt_clock_snapshot_state cs_state;
bt_event_class *out_event_class;
bt_packet *out_packet;
bt_event *out_event;
bt_event_class_borrow_stream_class_const(in_event_class));
if (default_cc) {
/* Borrow event clock snapshot. */
- cs_state =
- bt_message_event_borrow_default_clock_snapshot_const(
- in_message, &cs);
+ cs = bt_message_event_borrow_default_clock_snapshot_const(
+ in_message);
/* Create an output event message. */
- BT_ASSERT (cs_state == BT_CLOCK_SNAPSHOT_STATE_KNOWN);
out_message = bt_message_event_create_with_default_clock_snapshot(
debug_it->input_iterator,
out_event_class, out_packet,
const bt_message *in_message)
{
const bt_clock_class *default_cc;
- bt_clock_snapshot_state cs_state;
const bt_clock_snapshot *cs;
bt_message *out_message = NULL;
bt_packet *out_packet;
bt_packet_borrow_stream_const(in_packet)));
if (default_cc) {
/* Borrow clock snapshot. */
- cs_state =
- bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- in_message, &cs);
+ cs = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
+ in_message);
/* Create an output packet beginning message. */
- BT_ASSERT(cs_state == BT_CLOCK_SNAPSHOT_STATE_KNOWN);
out_message = bt_message_packet_beginning_create_with_default_clock_snapshot(
debug_it->input_iterator, out_packet,
bt_clock_snapshot_get_value(cs));
const bt_clock_snapshot *cs;
const bt_packet *in_packet;
const bt_clock_class *default_cc;
- bt_clock_snapshot_state cs_state;
bt_message *out_message = NULL;
bt_packet *out_packet;
bt_packet_borrow_stream_const(in_packet)));
if (default_cc) {
/* Borrow clock snapshot. */
- cs_state =
- bt_message_packet_end_borrow_default_clock_snapshot_const(
- in_message, &cs);
+ cs = bt_message_packet_end_borrow_default_clock_snapshot_const(
+ in_message);
/* Create an outpute packet end message. */
- BT_ASSERT(cs_state == BT_CLOCK_SNAPSHOT_STATE_KNOWN);
out_message = bt_message_packet_end_create_with_default_clock_snapshot(
debug_it->input_iterator, out_packet,
bt_clock_snapshot_get_value(cs));
const bt_stream *in_stream;
const bt_clock_class *default_cc;
uint64_t discarded_events, begin_cs_value, end_cs_value;
- bt_clock_snapshot_state begin_cs_state, end_cs_state;
bt_property_availability prop_avail;
bt_message *out_message = NULL;
bt_stream *out_stream;
default_cc = bt_stream_class_borrow_default_clock_class_const(
bt_stream_borrow_class_const(in_stream));
if (default_cc) {
- begin_cs_state =
+ begin_cs =
bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- in_message, &begin_cs);
- end_cs_state =
+ in_message);
+ end_cs =
bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
- in_message, &end_cs);
- /*
- * Both clock snapshots should be known as we check that the
- * all input stream classes have an always known clock. Unknown
- * clock is not yet supported.
- */
- BT_ASSERT(begin_cs_state == BT_CLOCK_SNAPSHOT_STATE_KNOWN &&
- end_cs_state == BT_CLOCK_SNAPSHOT_STATE_KNOWN);
+ in_message);
begin_cs_value = bt_clock_snapshot_get_value(begin_cs);
end_cs_value = bt_clock_snapshot_get_value(end_cs);
const bt_clock_class *default_cc;
const bt_stream *in_stream;
uint64_t discarded_packets, begin_cs_value, end_cs_value;
- bt_clock_snapshot_state begin_cs_state, end_cs_state;
bt_property_availability prop_avail;
bt_message *out_message = NULL;
bt_stream *out_stream;
default_cc = bt_stream_class_borrow_default_clock_class_const(
bt_stream_borrow_class_const(in_stream));
if (default_cc) {
- begin_cs_state =
+ begin_cs =
bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- in_message, &begin_cs);
+ in_message);
- end_cs_state =
+ end_cs =
bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
- in_message, &end_cs);
-
- /*
- * Both clock snapshots should be known as we check that the
- * all input stream classes have an always known clock. Unknown
- * clock is not yet supported.
- */
- BT_ASSERT(begin_cs_state == BT_CLOCK_SNAPSHOT_STATE_KNOWN &&
- end_cs_state == BT_CLOCK_SNAPSHOT_STATE_KNOWN);
+ in_message);
begin_cs_value = bt_clock_snapshot_get_value(begin_cs);
end_cs_value = bt_clock_snapshot_get_value(end_cs);
BT_ASSERT(!borrow_mapped_stream(d_maps, in_stream));
in_stream_class = bt_stream_borrow_class_const(in_stream);
- if (bt_stream_class_default_clock_is_always_known(in_stream_class)
- == BT_FALSE) {
- BT_LOGE("Stream class default clock class is not always "
- "known: in-sc-addr=%p", in_stream_class);
- goto end;
- }
-
md_maps = borrow_metadata_maps_from_input_stream_class(ir_maps, in_stream_class);
out_stream_class = borrow_mapped_stream_class(md_maps, in_stream_class);
if (!out_stream_class) {
goto end;
}
- if (bt_message_event_borrow_default_clock_snapshot_const(event_msg,
- &clock_snapshot) != BT_CLOCK_SNAPSHOT_STATE_KNOWN) {
- /*
- * No known default clock value: skip the timestamp
- * without an error.
- */
- goto end;
- }
+ clock_snapshot = bt_message_event_borrow_default_clock_snapshot_const(event_msg);
if (print_names) {
print_name_equal(pretty, "timestamp");
if (bt_stream_class_borrow_default_clock_class_const(stream_class)) {
switch (bt_message_get_type(msg)) {
case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
- bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- msg, &begin);
- bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
- msg, &end);
+ begin = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
+ msg);
+ end = bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_DISCARDED_PACKETS:
- bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- msg, &begin);
- bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
- msg, &end);
+ begin = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ msg);
+ end = bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
+ msg);
break;
default:
abort();
{
const bt_clock_snapshot *clock_snapshot = NULL;
int ret = 0;
- bt_clock_snapshot_state cs_state = BT_CLOCK_SNAPSHOT_STATE_KNOWN;
bt_message_stream_activity_clock_snapshot_state sa_cs_state;
BT_ASSERT(msg);
case BT_MESSAGE_TYPE_EVENT:
BT_ASSERT(bt_message_event_borrow_stream_class_default_clock_class_const(
msg));
- cs_state = bt_message_event_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_event_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_PACKET_BEGINNING:
BT_ASSERT(bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
msg));
- cs_state = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_PACKET_END:
BT_ASSERT(bt_message_packet_end_borrow_stream_class_default_clock_class_const(
msg));
- cs_state = bt_message_packet_end_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_packet_end_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
BT_ASSERT(bt_message_discarded_events_borrow_stream_class_default_clock_class_const(
msg));
- cs_state = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_DISCARDED_PACKETS:
BT_ASSERT(bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(
msg));
- cs_state = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING:
BT_ASSERT(bt_message_stream_activity_beginning_borrow_stream_class_default_clock_class_const(
break;
case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY:
- cs_state =
- bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
+ msg);
break;
default:
/* All the other messages have a higher priority */
goto end;
}
- BT_ASSERT(cs_state == BT_CLOCK_SNAPSHOT_STATE_KNOWN);
ret = bt_clock_snapshot_get_ns_from_origin(clock_snapshot, ts_ns);
if (ret) {
BT_LOGE("Cannot get nanoseconds from Epoch of clock snapshot: "
goto end;
}
- if (!bt_stream_class_default_clock_is_always_known(stream_class)) {
- BT_LOGE("Stream's default clock is not always known: "
- "stream-class-addr=%p, stream-class-name=\"%s\", "
- "stream-class-id=%" PRIu64,
- stream_class, bt_stream_class_get_name(stream_class),
- bt_stream_class_get_id(stream_class));
- ret = -1;
- goto end;
- }
-
ret = validate_clock_class(muxer_msg_iter, muxer_comp, clock_class);
end:
} else if (unlikely(bt_message_get_type(msg) ==
BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY)) {
const bt_clock_snapshot *cs;
- bt_clock_snapshot_state cs_state;
-
- cs_state = bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
- msg, &cs);
-
- if (cs_state != BT_CLOCK_SNAPSHOT_STATE_KNOWN) {
- BT_LOGE("Message iterator inactivity message's "
- "default clock snapshot is unknown: "
- "msg-addr=%p",
- msg);
- status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
- goto end;
- }
+ cs = bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
+ msg);
ret = validate_clock_class(muxer_msg_iter, muxer_comp,
bt_clock_snapshot_borrow_clock_class_const(cs));
if (ret) {
{
const bt_clock_class *clock_class = NULL;
const bt_clock_snapshot *clock_snapshot = NULL;
- bt_clock_snapshot_state cs_state = BT_CLOCK_SNAPSHOT_STATE_KNOWN;
bt_message_stream_activity_clock_snapshot_state sa_cs_state;
int ret = 0;
goto error;
}
- cs_state = bt_message_event_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_event_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_PACKET_BEGINNING:
clock_class =
goto error;
}
- cs_state = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_packet_beginning_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_PACKET_END:
clock_class =
goto error;
}
- cs_state = bt_message_packet_end_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_packet_end_borrow_default_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
clock_class =
goto error;
}
- cs_state = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_DISCARDED_PACKETS:
clock_class =
goto error;
}
- cs_state = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- msg, &clock_snapshot);
+ clock_snapshot = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ msg);
break;
case BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING:
clock_class =
break;
case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY:
- cs_state =
+ clock_snapshot =
bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
- msg, &clock_snapshot);
+ msg);
break;
default:
goto no_clock_snapshot;
}
- if (unlikely(cs_state != BT_CLOCK_SNAPSHOT_STATE_KNOWN)) {
- BT_LOGE_STR("Unsupported unknown clock snapshot.");
- ret = -1;
- goto end;
- }
-
ret = bt_clock_snapshot_get_ns_from_origin(clock_snapshot,
ns_from_origin);
if (unlikely(ret)) {
* know there's a default clock and it's always
* known.
*/
- (void) bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
- msg, &end_cs);
+ end_cs = bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
+ msg);
} else {
/*
* Safe to ignore the return value because we
* know there's a default clock and it's always
* known.
*/
- (void) bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
- msg, &end_cs);
+ end_cs = bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
+ msg);
}
if (bt_clock_snapshot_get_ns_from_origin(end_cs,
}
if (msg_type == BT_MESSAGE_TYPE_DISCARDED_EVENTS) {
- (void) bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
- msg, &begin_cs);
+ begin_cs = bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
+ msg);
new_msg = bt_message_discarded_events_create_with_default_clock_snapshots(
trimmer_it->self_msg_iter,
sstate->stream,
bt_clock_snapshot_get_value(begin_cs),
end_raw_value);
} else {
- (void) bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
- msg, &begin_cs);
+ begin_cs = bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
+ msg);
new_msg = bt_message_discarded_packets_create_with_default_clock_snapshots(
trimmer_it->self_msg_iter,
sstate->stream,
goto end;
}
- if (!bt_stream_class_default_clock_is_always_known(sc)) {
- BT_LOGE("Unsupported stream: clock does not "
- "always have a known value: "
- "stream-addr=%p, "
- "stream-id=%" PRIu64 ", "
- "stream-name=\"%s\"",
- stream, bt_stream_get_id(stream),
- bt_stream_get_name(stream));
- status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
- goto end;
- }
-
sstate = g_new0(struct trimmer_iterator_stream_state,
1);
if (!sstate) {