lib: add discarded events message
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 11 Feb 2019 20:54:47 +0000 (15:54 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:37 +0000 (18:19 -0400)
commit8f1a1bbbb81e6a4aa6988ced8f275bb175127c43
tree86c154b6509c18c29117384c2c1a7cd8c396c372
parent13c228f1e2ae0f997059c119d6400a825a98a2a4
lib: add discarded events message

This patch implements the "discarded events" message API. You can create
such a message to communicate that events were discarded at the source
level.

This message conveys redundant information considering the "discarded
event counter" property of a packet object. However, this property will
be removed before 2.0-rc1, and the discarded event message will be the
only way to indicate discarded events. The rationale behind this is that
the beginning and end times of the packet object do not represent a
stream activity time range (this is indicated by stream activity
beginning and end messages now); they are used for discarded event and
packet counter time ranges (when using multiple packets). To make this
less confusing, discarded events and packets are or will be their own
messages. For the time being, both the properties and the messages
coexist.

There are two ways to create a discarded events message:

bt_message_discarded_events_create():
    Create a message using a stream of which the class has no default
    clock class. This indicates that a number of events were discarded
    at this point within the message flow.

bt_message_discarded_events_create_with_default_clock_snapshots():
    Create a message using a stream of which the class has a default
    clock class. In this case, you must pass the beginning and end clock
    snapshot raw values which delimit the time range when events were
    discarded by the tracer.

    Within the message flow, the beginning time must be greater than or
    equal to the previous message's time (depending on its type). The
    end time can be greater than the next message's time. For example,
    the `ctf` plugin sources will push such a message following a packet
    end message, and the time range will be said packet end message's
    packet's end time to the next packet's end time.

By default, the message indicates that "a number" of events were
discarded. In other words, bt_message_discarded_events_get_count()
returns `BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE`. To be more accurate,
use bt_message_discarded_events_set_count() to set a specific discarded
event count.

The implementation deals with "discarded items" message objects because
the same code will be used to implement the discarded packets message
API.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/graph/message-const.h
include/babeltrace/graph/message-discarded-events-const.h [new file with mode: 0644]
include/babeltrace/graph/message-discarded-events.h [new file with mode: 0644]
include/babeltrace/graph/message-discarded-items-internal.h [new file with mode: 0644]
include/babeltrace/graph/message-internal.h
lib/graph/message/Makefile.am
lib/graph/message/discarded-items.c [new file with mode: 0644]
lib/graph/message/message.c
lib/lib-logging.c
This page took 0.025712 seconds and 4 git commands to generate.