diff mbox

[babeltrace] Fix: text output missing separator when printing the domain

Message ID 1489781723-23942-1-git-send-email-jdesfossez@efficios.com
State Accepted, archived
Delegated to: Jérémie Galarneau
Headers show

Commit Message

Julien Desfossez March 17, 2017, 8:15 p.m. UTC
With the "-f all" option, we expect to see
<hostname>:<domain>:<loglevel>, but instead we see
<hostname><domain>:<loglevel>.

Judging from the pattern of the other printed fields, the check for
"dom_print" variable seems to be missing when printing the domain.

Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
---
 formats/ctf-text/ctf-text.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jérémie Galarneau May 26, 2017, 1:36 p.m. UTC | #1
Merged in master, stable-1.5, and stable-1.4. Thanks!

Jérémie

On 17 March 2017 at 16:15, Julien Desfossez <jdesfossez at efficios.com> wrote:
> With the "-f all" option, we expect to see
> <hostname>:<domain>:<loglevel>, but instead we see
> <hostname><domain>:<loglevel>.
>
> Judging from the pattern of the other printed fields, the check for
> "dom_print" variable seems to be missing when printing the domain.
>
> Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
> ---
>  formats/ctf-text/ctf-text.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c
> index f615161..69450cf 100644
> --- a/formats/ctf-text/ctf-text.c
> +++ b/formats/ctf-text/ctf-text.c
> @@ -350,6 +350,8 @@ int ctf_text_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definitio
>                 set_field_names_print(pos, ITEM_HEADER);
>                 if (pos->print_names) {
>                         fprintf(pos->fp, "trace:domain = ");
> +               } else if (dom_print) {
> +                       fprintf(pos->fp, ":");
>                 }
>                 fprintf(pos->fp, "%s", stream_class->trace->env.domain);
>                 if (pos->print_names)
> --
> 2.7.4
>
diff mbox

Patch

diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c
index f615161..69450cf 100644
--- a/formats/ctf-text/ctf-text.c
+++ b/formats/ctf-text/ctf-text.c
@@ -350,6 +350,8 @@  int ctf_text_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definitio
 		set_field_names_print(pos, ITEM_HEADER);
 		if (pos->print_names) {
 			fprintf(pos->fp, "trace:domain = ");
+		} else if (dom_print) {
+			fprintf(pos->fp, ":");
 		}
 		fprintf(pos->fp, "%s", stream_class->trace->env.domain);
 		if (pos->print_names)