lib: add discarded packets message
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 11 Feb 2019 21:25:45 +0000 (16:25 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 12 Apr 2019 21:26:17 +0000 (17:26 -0400)
commit9d4fe51cb782f947750b9495a4f244377f9a20e6
tree689ca1af8817a6be113c746009a29044b9e6401b
parentc51361aa65eb1302cb3e053087f4b965d0b6a853
lib: add discarded packets message

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

This message conveys redundant information considering the "packet
counter" property of a packet object. However, this property will be
removed before 2.0-rc1, and the discarded packet message will be the
only way to indicate discarded packets. 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 their own messages. For
the time being, both the properties and the messages coexist.

There are two ways to create a discarded packets message:

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

bt_message_discarded_packets_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 packets 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 must be less than or equal to 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 beginning time.

In the message flow, you can only insert this message, for a given
stream:

* Between packet end and packet beginning messages.
* Before the first packet beginning message.
* After the last packet end message.

In other words, you cannot insert this message in the middle of a
packet.

By default, the message indicates that "a number" of packets were
discarded. In other words, bt_message_discarded_packets_get_count()
returns `BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE`. To be more accurate,
use bt_message_discarded_packets_set_count() to set a specific discarded
packet count.

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-packets-const.h [new file with mode: 0644]
include/babeltrace/graph/message-discarded-packets.h [new file with mode: 0644]
lib/graph/message/discarded-items.c
lib/graph/message/message.c
lib/lib-logging.c
This page took 0.026492 seconds and 5 git commands to generate.