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

Fei, Jie/费 杰 feij.fnst at cn.fujitsu.com
Mon Feb 6 05:50:32 UTC 2017


Hi Dave,

Thanks for Rabin's work and your review, this patch is fine to me.
Hope you can push it in.

Thanks,
Fei

On 01/31/2017 10:11 PM, Dave Anderson wrote:
> Hi Rabin,
>
> The patch looks fine to me -- forwarding to the trace.c maintainer Jie Fei
> directly for his ACK.
>
> Thanks,
>    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