From: Simon Marchi Date: Wed, 9 Mar 2022 16:47:04 +0000 (-0500) Subject: sink.text.details: show event class namespace X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=e6a1c74136b95aa325422b7f1bdfa4d656701568;p=babeltrace.git sink.text.details: show event class namespace If the event class has namespace (a property introduced with MIP 1), show it when dumping the event class info. Example output: Event class `da-ec-name` (Namespace `da-ec-namespace`, ID 0): Change-Id: Ief4363545a6379c16e229b29d8a2e0b121b4777f Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/7531 Tested-by: jenkins Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/12694 --- diff --git a/src/plugins/text/details/write.c b/src/plugins/text/details/write.c index 5cc023c0..cf172f50 100644 --- a/src/plugins/text/details/write.c +++ b/src/plugins/text/details/write.c @@ -1355,13 +1355,25 @@ void write_event_class(struct details_write_ctx *ctx, const bt_event_class *ec) write_indent(ctx); write_obj_type_name(ctx, "Event class"); - /* Write name and ID */ + /* Write name, namespace and ID */ if (name) { g_string_append_printf(ctx->str, " `%s%s%s`", color_fg_green(ctx), name, color_reset(ctx)); } - g_string_append(ctx->str, " (ID "); + g_string_append(ctx->str, " ("); + + if (ctx->details_comp->mip_version >= 1) { + const char *ns = bt_event_class_get_namespace(ec); + + if (ns) { + g_string_append(ctx->str, "Namespace `"); + write_none_prop_value(ctx, ns); + g_string_append(ctx->str, "`, "); + } + } + + g_string_append(ctx->str, "ID "); write_uint_prop_value(ctx, bt_event_class_get_id(ec)); g_string_append(ctx->str, "):\n");