Skip to contentSkip to conversation

Support for empty payload ?

barectf Simon Marchi 3 participants 4 messages Mar 25, 2016 – Mar 29, 2016 4 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 16 lines · Jean-François Monestier

Hello Tracers,

Does anyone know whether barectf supports some sort of empty payloads for events specified in the .yaml configuration file ?

Something such as the well-known lttng_ust_statedump:start event :

event {
        name = "lttng_ust_statedump:start";
        id = 0;
        stream_id = 0;
        loglevel = 13;
        fields := struct {
        };
};
Quoted 7 lines

I can't figure out the yaml syntax for such an event, your help would be welcome.

I must confess I'm still stuck to barectf v2.0.2

Thanks in advance,

Hi Jean-François,

I don't believe barectf allows specifying empty payloads as of now. Trying to specify an empty fields dict, such as:

simple_uint32:
log-level: CRIT
payload-type:

    class: struct
    fields: {}

yields:

Error:
cannot create configuration from YAML file "config.yaml":
metadata error:
invalid event in stream "default":
event payload type must have at least one field for event
"simple_uint32"

See: https://github.com/efficios/barectf/blob/master/barectf/config.py#L1119

The maintainers will be able to confirm/infirm, and say whether it's in the plans to add support for that.

Simon
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 45 lines · Simon Marchi
Quoted 16 lines · Jean-François Monestier

Hello Tracers,

Does anyone know whether barectf supports some sort of empty payloads for events specified in the .yaml configuration file ?

Something such as the well-known lttng_ust_statedump:start event :

event {
         name = "lttng_ust_statedump:start";
         id = 0;
         stream_id = 0;
         loglevel = 13;
         fields := struct {
         };
};
Quoted 7 lines

I can't figure out the yaml syntax for such an event, your help would be welcome.

I must confess I'm still stuck to barectf v2.0.2

Thanks in advance,

Hi Jean-François,

I don't believe barectf allows specifying empty payloads as of now. Trying to specify an empty fields dict, such as:

simple_uint32:

    log-level: CRIT
    payload-type:
      class: struct
      fields: {}

yields:

Error:
cannot create configuration from YAML file "config.yaml":
metadata error:
invalid event in stream "default":
event payload type must have at least one field for event
"simple_uint32"

Quoted 8 lines

See:
https://github.com/efficios/barectf/blob/master/barectf/config.py#L1119

The maintainers will be able to confirm/infirm, and say whether it's in the plans to add support for that.

Simon

Thank you, Simon, for your prompt response.

I should have mentionned it, but my numerous, 'creative' attempts popped up a few error messages, such as

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
missing "payload-type" property in event object

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
cannot create event's payload type object:
type objects must be associative arrays

Error:
cannot create configuration from YAML file:
metadata error:
invalid event in stream "default":
event payload type must have at least one field for event "start"

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
cannot create event's payload type object:
"fields" property of structure type object must be an associative array

Bye for now,

Signature · 6 lines
Jean-Francois Monestier
041-6766
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 21 lines · Jean-François Monestier
Quoted 19 lines · Simon Marchi
Quoted 17 lines · Jean-François Monestier

Hello Tracers,

Does anyone know whether barectf supports some sort of empty payloads for events specified in the .yaml configuration file ?

Something such as the well-known lttng_ust_statedump:start event :

event {
         name = "lttng_ust_statedump:start";
         id = 0;
         stream_id = 0;
         loglevel = 13;
         fields := struct {
         };
};
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I can't figure out the yaml syntax for such an event, your help would be welcome.

Hi Jean-François,

Thanks for writing.

This was an arbitrary limitation, and I can't remember why it was like that.

I write "was" because I just "fixed" it in v2.1.3. The only requirement now is that the event must contain at least one field in one of the following types:

* The event header type of its parent stream
* The event context type of its parent stream
* Its context type
* Its payload type

In other words, the event cannot be completely empty. This would make it impossible for the reader to finish, since it would mean a stream of many 0-sized events (since there's no event ID, there's only one event in this stream). Babeltrace does not like this:

[error] Invalid 0 byte event encountered.
[error] Reading event failed.

All the following event objects should work as expected in v2.1.3:

1. Empty event object:

         {}

2. Null payload type (sets the payload type to its default value, which is no payload type):

payload-type: null

3. Structure with no fields (you must still explicitly align the type to at least 8-bit; this is a requirement for object types which is usually satisfied by the fact that one of the fields is byte-aligned):

payload-type:
class: struct
min-align: 8

I added such an event in the linux-fs-simple example, and it seems like everything is okay on the Babeltrace side afterwards:

    ...
    context_no_payload: { }, { a = 223, b = "ctx" }, { }
    ...
    no_context_no_payload: { }, { }
    ...
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I must confess I'm still stuck to barectf v2.0.2

May I ask you why you're "stuck" at v2.0.2? How are you installing barectf?

barectf v2.1 is fully backward-compatible with v2.0 (supports config files with version 2.0), so upgrading it is just a matter of running:

    pip3 install --upgrade barectf
Quoted 25 lines
Quoted 25 lines
Quoted 3 lines

Thanks in advance,

Hi Jean-François,

I don't believe barectf allows specifying empty payloads as of now. Trying to specify an empty fields dict, such as:

simple_uint32:

    log-level: CRIT
    payload-type:
      class: struct
      fields: {}

yields:

Error:
cannot create configuration from YAML file "config.yaml":
metadata error:
invalid event in stream "default":
event payload type must have at least one field for event
"simple_uint32"

Quoted 5 lines
Quoted 5 lines

See:
https://github.com/efficios/barectf/blob/master/barectf/config.py#L1119

The maintainers will be able to confirm/infirm, and say whether it's in the plans to add support for that.

Thanks for the fast support ;-).

Quoted 40 lines
Quoted 3 lines

Simon

Thank you, Simon, for your prompt response.

I should have mentionned it, but my numerous, 'creative' attempts popped up a few error messages, such as

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
missing "payload-type" property in event object

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
cannot create event's payload type object:
type objects must be associative arrays

Error:
cannot create configuration from YAML file:
metadata error:
invalid event in stream "default":
event payload type must have at least one field for event "start"

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
cannot create event's payload type object:
"fields" property of structure type object must be an associative array

Bye for now,
--
Jean-Francois Monestier
041-6766

Quoted 4 lines

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): CAB4xu_3BBH5WzX3NHcF+H97VmAaRXKr-T2bK+HEVkuzcK39zbw@mail.gmail.com

#7 lore raw

Hello

Indeed, upgrading barectf to v2.1.3 works like a charm !

Thank you very much

Quoted 167 lines · Philippe Proulx
Quoted 21 lines · Jean-François Monestier
Quoted 19 lines · Simon Marchi
Quoted 17 lines · Jean-François Monestier

Hello Tracers,

Does anyone know whether barectf supports some sort of empty payloads for events specified in the .yaml configuration file ?

Something such as the well-known lttng_ust_statedump:start event :

event {
          name = "lttng_ust_statedump:start";
          id = 0;
          stream_id = 0;
          loglevel = 13;
          fields := struct {
          };
};
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I can't figure out the yaml syntax for such an event, your help would be welcome.

Hi Jean-François,

Thanks for writing.

This was an arbitrary limitation, and I can't remember why it was like that.

I write "was" because I just "fixed" it in v2.1.3. The only requirement now is that the event must contain at least one field in one of the following types:

* The event header type of its parent stream
* The event context type of its parent stream
* Its context type
* Its payload type

In other words, the event cannot be completely empty. This would make it impossible for the reader to finish, since it would mean a stream of many 0-sized events (since there's no event ID, there's only one event in this stream). Babeltrace does not like this:

[error] Invalid 0 byte event encountered.
[error] Reading event failed.

All the following event objects should work as expected in v2.1.3:

1. Empty event object:

          {}

2. Null payload type (sets the payload type to its default value, which is no payload type):

payload-type: null

3. Structure with no fields (you must still explicitly align the type to at least 8-bit; this is a requirement for object types which is usually satisfied by the fact that one of the fields is byte-aligned):

payload-type:
class: struct
min-align: 8

I added such an event in the linux-fs-simple example, and it seems like everything is okay on the Babeltrace side afterwards:

     ...
     context_no_payload: { }, { a = 223, b = "ctx" }, { }
     ...
     no_context_no_payload: { }, { }
     ...
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I must confess I'm still stuck to barectf v2.0.2

May I ask you why you're "stuck" at v2.0.2? How are you installing barectf?

barectf v2.1 is fully backward-compatible with v2.0 (supports config files with version 2.0), so upgrading it is just a matter of running:

     pip3 install --upgrade barectf
Quoted 25 lines
Quoted 25 lines
Quoted 3 lines

Thanks in advance,

Hi Jean-François,

I don't believe barectf allows specifying empty payloads as of now. Trying to specify an empty fields dict, such as:

simple_uint32:

     log-level: CRIT
     payload-type:
       class: struct
       fields: {}

yields:

Error:
cannot create configuration from YAML file "config.yaml":
metadata error:
invalid event in stream "default":
event payload type must have at least one field for event
"simple_uint32"

Quoted 5 lines
Quoted 5 lines

See:
https://github.com/efficios/barectf/blob/master/barectf/config.py#L1119

The maintainers will be able to confirm/infirm, and say whether it's in the plans to add support for that.

Thanks for the fast support ;-).

Quoted 44 lines
Quoted 3 lines

Simon

Thank you, Simon, for your prompt response.

I should have mentionned it, but my numerous, 'creative' attempts popped up a few error messages, such as

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
missing "payload-type" property in event object

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
cannot create event's payload type object:
type objects must be associative arrays

Error:
cannot create configuration from YAML file:
metadata error:
invalid event in stream "default":
event payload type must have at least one field for event "start"

Error:
cannot create configuration from YAML file:
cannot create stream "default":
cannot create event "start":
cannot create event's payload type object:
"fields" property of structure type object must be an associative array

Bye for now,
--
Jean-Francois Monestier
041-6766

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 6 lines
Jean-Francois Monestier
041-6766
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev