sink.text.details: show event class namespace
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 9 Mar 2022 16:47:04 +0000 (11:47 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
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 <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7531
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12694

src/plugins/text/details/write.c

index 5cc023c0afd79115e538c60de396f489a2665d96..cf172f506b312d32fac8b0977781441846f2aba6 100644 (file)
@@ -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");
 
This page took 0.025508 seconds and 4 git commands to generate.