Fix: mi print of probe attributes + validation
A message that is not in the archive (sent off-list or not yet received): [email protected]
Merged
Quoted 102 lines · Jonathan Rajotte Julien
Signed-off-by Jonathan Rajotte Julien <[email protected]>--- src/common/mi-lttng.c | 37 ++++++++++++++++++++++++++++++++++++- src/common/mi_lttng.xsd | 6 +++--- 2 files changed, 39 insertions(+), 4 deletions(-)src/common/mi-lttng.c +36
-1@@ -914,6 +914,16 @@ int mi_lttng_event_function_probe(struct mi_writer *writer, {int ret; + ret =mi_lttng_writer_open_element (writer, config_element_attributes); +if (ret) { + goto end; + } + + ret =mi_lttng_writer_open_element (writer, config_element_probe_attributes); +if (ret) { + goto end; + } +if (event->attr.probe.addr !=0 ) {/* event probe address */ ret = mi_lttng_writer_write_element_unsigned_int(writer,@@ -936,6 +946,9 @@ int mi_lttng_event_function_probe(struct mi_writer *writer, goto end; } } + +/* Close probe_attributes and attributes */ + ret =mi_lttng_close_multi_element (writer,2 ); end:return ret; }@@ -944,9 +957,29 @@ LTTNG_HIDDENint mi_lttng_event_function_entry (struct mi_writer *writer,struct lttng_event *event) { +int ret; + + ret =mi_lttng_writer_open_element (writer, config_element_attributes); +if (ret) { + goto end; + } + + ret =mi_lttng_writer_open_element (writer, config_element_probe_attributes); +if (ret) { + goto end; + } +/* event probe symbol_name */ -return mi_lttng_writer_write_element_string (writer, + ret =mi_lttng_writer_write_element_string (writer, config_element_symbol_name, event->attr.ftrace.symbol_name); +if (ret) { + goto end; + } + +/* Close function_attributes and attributes */ + ret =mi_lttng_close_multi_element (writer,2 ); +end: +return ret; }LTTNG_HIDDEN @@ -976,6 +1009,8 @@ int mi_lttng_event(struct mi_writer *writer, }break ; } +case LTTNG_EVENT_FUNCTION : +/* Fallthrough */ case LTTNG_EVENT_PROBE : ret =mi_lttng_event_function_probe (writer, event);break ;src/common/mi_lttng.xsd +3
-3@@ -146,9 +146,9 @@ THE SOFTWARE. <!-- Maps to the lttng_event_probe_attr struct --> <xs:complexType name="event_probe_attributes_type"> <xs:all> - <xs:element name="address" type="uint64_type" /> - <xs:element name="offset" type="uint64_type" /> - <xs:element name="symbol_name" type="name_type" /> + <xs:element name="address" type="uint64_type" minOccurs="0" /> + <xs:element name="offset" type="uint64_type" minOccurs="0" /> + <xs:element name="symbol_name" type="name_type" minOccurs="0" /> </xs:all> </xs:complexType>Signature · 7 lines
2.0.4 _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev