diff mbox series

[v2,59/87] trace-cmd report: Do not print empty buffer name

Message ID 20210729050959.12263-60-tz.stoyanov@gmail.com (mailing list archive)
State Superseded
Headers show
Series Trace file version 7 | expand

Commit Message

Tzvetomir Stoyanov (VMware) July 29, 2021, 5:09 a.m. UTC
In trace file version 7, the top buffer is saved with its empty
file name, string "". When displaying it, filter those empty strings.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 tracecmd/trace-read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steven Rostedt Aug. 19, 2021, 7:21 p.m. UTC | #1
On Thu, 29 Jul 2021 08:09:31 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> In trace file version 7, the top buffer is saved with its empty
> file name, string "". When displaying it, filter those empty strings.

This looks like it could have been folded into another patch.

-- Steve

> 
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
> ---
>  tracecmd/trace-read.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
> index a36d72e4..1868a830 100644
> --- a/tracecmd/trace-read.c
> +++ b/tracecmd/trace-read.c
> @@ -1175,7 +1175,7 @@ static void print_handle_file(struct handle_list *handles)
>  	/* Only print file names if more than one file is read */
>  	if (!multi_inputs && !instances)
>  		return;
> -	if (handles->file)
> +	if (handles->file && *handles->file != '\0')
>  		printf("%*s: ", max_file_size, handles->file);
>  	else
>  		printf("%*s  ", max_file_size, "");
diff mbox series

Patch

diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c
index a36d72e4..1868a830 100644
--- a/tracecmd/trace-read.c
+++ b/tracecmd/trace-read.c
@@ -1175,7 +1175,7 @@  static void print_handle_file(struct handle_list *handles)
 	/* Only print file names if more than one file is read */
 	if (!multi_inputs && !instances)
 		return;
-	if (handles->file)
+	if (handles->file && *handles->file != '\0')
 		printf("%*s: ", max_file_size, handles->file);
 	else
 		printf("%*s  ", max_file_size, "");