X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fmi-lttng.c;h=cb30e507ec10a9bc88ead14dde8fb7aa55e4cef7;hb=ea75976abd0ccf78161987eede3c0ed59df2f209;hp=83df149f2bc5c2eb9583ed22854bea70350c1cff;hpb=705bb62fac2a79ed3e04232cc831645c852cc1a2;p=lttng-tools.git diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c index 83df149f2..cb30e507e 100644 --- a/src/common/mi-lttng.c +++ b/src/common/mi-lttng.c @@ -147,6 +147,7 @@ const char * const mi_lttng_element_snapshots = "snapshots"; * Those should never overlap by definition * (see struct lttng_event loglevel) */ +LTTNG_HIDDEN const char *mi_lttng_loglevel_string(int value) { switch (value) { @@ -205,6 +206,7 @@ const char *mi_lttng_loglevel_string(int value) } } +LTTNG_HIDDEN const char *mi_lttng_logleveltype_string(enum lttng_loglevel_type value) { switch (value) { @@ -219,6 +221,7 @@ const char *mi_lttng_logleveltype_string(enum lttng_loglevel_type value) } } +LTTNG_HIDDEN const char *mi_lttng_eventtype_string(enum lttng_event_type value) { switch (value) { @@ -241,6 +244,7 @@ const char *mi_lttng_eventtype_string(enum lttng_event_type value) } } +LTTNG_HIDDEN const char *mi_lttng_event_contexttype_string(enum lttng_event_context_type val) { switch (val) { @@ -279,6 +283,7 @@ const char *mi_lttng_event_contexttype_string(enum lttng_event_context_type val) } } +LTTNG_HIDDEN const char *mi_lttng_eventfieldtype_string(enum lttng_event_field_type val) { switch (val) { @@ -295,6 +300,7 @@ const char *mi_lttng_eventfieldtype_string(enum lttng_event_field_type val) } } +LTTNG_HIDDEN const char *mi_lttng_domaintype_string(enum lttng_domain_type value) { /* Note: This is a *duplicate* of get_domain_str from bin/lttng/utils.c */ @@ -313,6 +319,7 @@ const char *mi_lttng_domaintype_string(enum lttng_domain_type value) } } +LTTNG_HIDDEN const char *mi_lttng_buffertype_string(enum lttng_buffer_type value) { switch (value) { @@ -328,6 +335,7 @@ const char *mi_lttng_buffertype_string(enum lttng_buffer_type value) } } +LTTNG_HIDDEN const char *mi_lttng_calibratetype_string(enum lttng_calibrate_type val) { const char *ret; @@ -914,6 +922,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 +954,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 +965,29 @@ LTTNG_HIDDEN int 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 +1017,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;