sink.text.details: print user attributes
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 14 Aug 2019 17:34:10 +0000 (13:34 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:21 +0000 (11:58 -0400)
commit7753db0d6dc99750df8e5c940076c7bfa826fb6b
tree961a9f411a1a916be354b8ed2eb4a61100f89df1
parent84ff66df6192f7f5aa6a4f25e0f942f3f378bdd8
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.02607 seconds and 4 git commands to generate.