Re: [PATCH v5 24/25] trace-cmd: Call additional APIs when creating trace file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 11 Nov 2021 17:11:32 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> diff --git a/tracecmd/trace-restore.c b/tracecmd/trace-restore.c
> index 8d2fcae8..a903c21a 100644
> --- a/tracecmd/trace-restore.c
> +++ b/tracecmd/trace-restore.c
> @@ -163,6 +163,7 @@ void trace_restore (int argc, char **argv)
>  
>  	if (tracecmd_append_cpu_data(handle, args, &argv[first_arg]) < 0)
>  		die("failed to append data");
> -
> +	if (tracecmd_get_out_file_version(handle) >= FILE_VERSION_SECTIONS)
> +		tracecmd_write_options(handle);

I wonder if we are just missing a tracecmd_output_close() here?

And that will write the options as I mentioned before.

>  	return;
>  }
> diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
> index e4a0c3b3..671d6e9f 100644
> --- a/tracecmd/trace-split.c
> +++ b/tracecmd/trace-split.c
> @@ -391,6 +391,9 @@ static double parse_file(struct tracecmd_input *handle,
>  	if (tracecmd_append_cpu_data(ohandle, cpus, cpu_list) < 0)
>  		die("Failed to append tracing data\n");
>  
> +	if (tracecmd_get_out_file_version(ohandle) >= FILE_VERSION_SECTIONS)
> +		tracecmd_write_options(ohandle);
> +

And no more is written here to ohandle, and the close should fix it as well.

-- Steve

>  	current = end;
>  	for (cpu = 0; cpu < cpus; cpu++) {
>  		/* Set the tracecmd cursor to the next set of records */




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux