Re: [PATCH v5 12/25] trace-cmd library: Do not write CPUs with empty trace data

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

 



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

> Trace file version 7 has more flexible design, which allows to write only
> CPUs with trace data in the file. If a CPU has no recorded trace data,
> do not put it in the trace file version 7.
> 

Will both trace-cmd record and report still report that a CPU had no data?
Because that is useful information.

-- Steve


> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
> ---
>  lib/trace-cmd/trace-output.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c
> index 028ad580..2ed7155b 100644
> --- a/lib/trace-cmd/trace-output.c
> +++ b/lib/trace-cmd/trace-output.c
> @@ -2079,8 +2079,10 @@ int tracecmd_write_cpu_data(struct tracecmd_output *handle,
>  
>  	if (i < cpus)
>  		ret = -1;
> -	else
> +	else if (size || !HAS_SECTIONS(handle))
>  		ret = out_write_cpu_data(handle, cpus, data, buff_name);
> +	else
> +		ret = 0;
>  
>  	for (i--; i >= 0; i--)
>  		close(data[i].fd);




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

  Powered by Linux