+static void maybe_add_trigger(struct context *ctx, GString *out)
+{
+ int offset;
+
+ if (ctx->trigger < 0)
+ return;
+ offset = ctx->trigger;
+ ctx->trigger = -1;
+
+ /*
+ * Sample data lines have one character per bit and
+ * no separator between bytes. Align trigger marker
+ * to this layout.
+ */
+ g_string_append_printf(out, "%*s:%*s %d\n",
+ (int)ctx->max_namelen, "T",
+ offset + 1, "^", offset);
+}
+