sink.text.details: print user attributes
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 14 Aug 2019 17:34:10 +0000 (13:34 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 15 Aug 2019 15:41:44 +0000 (11:41 -0400)
commit48be9a9176ef8d3a81390d43769093d91e9d5227
treed5ae71d093736c6e6249bb2d099bc1f4b3b24a60
parentce45f74af0b84ec3e27cd147147262fb2b15ec4c
sink.text.details: print user attributes

This patch makes a `sink.text.details` component print user attributes.

The component only prints user attributes when the map value is not
empty.

The output looks like this:

    Event class (ID 0):
      User attributes:
        domain: Python
        ip: Length 4:
          [0]: 192
          [1]: 168
          [2]: 0
          [3]: 100
        weight: 17.231600
        with-net: Yes
      ...

The new write_value() function textually and recursively serializes a
value object. When writing a map value object, the keys are sorted
first.

The change brought by this patch is not invasive in that all the current
test expectation files do not need any change because the sources never
set any user attribute. The goal of this patch is not to add any textual
noise.

When an enumeration, a structure, or a variant field class has user
attributes, the component prints the mappings, members, and options
indented within a dedicated section, for example:

    Payload field class: Structure (3 members):
      User attributes:
        a: 23
        b: 'log'
      Members:
        hello: String
        bbb: Boolean
        opt: Option:
          Content: Unsigned integer (64-bit, Base 10)

The same strategy applies to structure field class members and variant
field class options:

    Payload field class: Structure (3 members):
      hello:
        Field class: String
        User attributes:
          factor: 17.150000
      bbb: Boolean
      opt: Option:
        Content: Unsigned integer (64-bit, Base 10)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Icf3060dbf23bab607ebb7af6e839aa5b28bd2658
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1926
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/plugins/text/details/write.c
This page took 0.024542 seconds and 4 git commands to generate.