Remove the concept of event class attributes
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 15 Jun 2017 22:38:45 +0000 (18:38 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 16 Jun 2017 19:54:34 +0000 (15:54 -0400)
commitcf76ce92f8f8ae74ec9e1305e8ef83ac1bc4fb26
tree4fc1a6e212896bebaf6c730988f54c07377ea51a
parent2f4b93cd29ab927436c42544ef6fccfb33429c0f
Remove the concept of event class attributes

The concept of event class attributes could be confusing with the
eventual concept of user attributes to be introduced in CTF 2. This is
not strictly required for Babeltrace 2.0: we can create dedicated
accessors for CTF 1.8 attributes (ID, name, log level, EMF URI). This is
what this patch does, removing the attributes API and adding:

* bt_ctf_event_class_get_log_level()
* bt_ctf_event_class_set_log_level()
* bt_ctf_event_class_get_emf_uri()
* bt_ctf_event_class_set_emf_uri()

There are already accessors for the name and ID attributes. As to the
stream class ID (`stream_id`) attribute, it should never have existed in
the first place because you can always use the parent stream class's ID.
Thus this patch also fixes a bug where there was a synchronization
problem between a stream class's ID and the `stream_id` attribute of its
contained event classes.

The bt_ctf_event_class_get_log_level() and
bt_ctf_event_class_set_log_level() functions use the new
`enum bt_ctf_event_class_log_level` enumeration which contains all the
log levels of LTTng-UST, which happen to be CTF 1.8's log levels too
because Babeltrace 1 prints those names for those values whatever the
trace's producer. A translation is performed from the numeric values to
this enumeration in plugins/ctf/common/metadata/visitor-generate-ir.c,
and the reverse is done in plugins/text/pretty/print.c. Knowing this,
the `loglevel_string` attribute that visitor-generate-ir.c used to add
to event classes (and which plugins/text/pretty/print.c used to
pretty-print the names) is removed. This was also an issue because
Babeltrace 1 does not know `loglevel_string` and sink.ctf.fs, through
the CTF writer implementation, was serializing this attribute in the
generated metadata.

tests/lib/test_ctf_writer.c is updated to test the individual accessors
instead of the generic attribute API.

plugins/libctfcopytrace/ctfcopytrace.c is updated to copy the known
attributes intead of using the generic attribute API.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/ctf-ir/event-class-internal.h
include/babeltrace/ctf-ir/event-class.h
lib/ctf-ir/event-class.c
lib/ctf-ir/stream-class.c
plugins/ctf/common/metadata/visitor-generate-ir.c
plugins/libctfcopytrace/ctfcopytrace.c
plugins/text/pretty/print.c
tests/lib/test_ctf_writer.c
This page took 0.025624 seconds and 4 git commands to generate.