[Crash-utility] [PATCH] trace: don't use uninited max_tr_ring_buffer

Dave Anderson anderson at redhat.com
Tue Feb 7 16:40:53 UTC 2017



----- Original Message -----
> From: Fei, Jie <feij at fnst.cn.fujitsu.com>
>
> Hi Dave,
>
> Thanks for Rabin's work and your review, this patch is fine to me.
> Hope you can push it in.
>
> Thanks,
> Fei

Thanks guys,

Queued for crash-7.1.8:

  https://github.com/crash-utility/crash/commit/9c498443164c331e6dbbf461d9fe4c4c095a73ad

Dave



----- Original Message -----
> From: Rabin Vincent <rabinv at axis.com>
> 
> This max buffer is not available in all configurations of the kernel so
> we shouldn't attempt to use the unitialized max_tr_ring_buffer variable.
> A similar check existed previously before the recent rework of the trace
> extension to support multiple buffers.
> ---
>  extensions/trace.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/extensions/trace.c b/extensions/trace.c
> index 51df98d..22039a9 100644
> --- a/extensions/trace.c
> +++ b/extensions/trace.c
> @@ -487,6 +487,9 @@ static int ftrace_init_trace(struct trace_instance *ti,
> ulong instance_addr)
>  			ti->pages) < 0)
>  		goto out_fail;
>  
> +	if (!ti->max_tr_ring_buffer)
> +		return 0;
> +
>  	ti->max_tr_buffers = calloc(sizeof(*ti->max_tr_buffers), nr_cpu_ids);
>  	if (ti->max_tr_buffers == NULL)
>  		goto out_fail;
> --
> 2.1.4
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
> 




More information about the Crash-utility mailing list