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

[Xen-devel] [PATCH]Fix Trace Buffer Allocation Error



Hi, All.

 This is a Patch for Trace Buffer allocation Error.
Currently, Trace Buffer Management uses two variables
(opt_tbuf_size & tb_init_done)

Variable "opt_tbuf_size" is  setting a tbuf_size and keeps the tbuf_size.
Variable "tb_init_done" is a flag to do trace buffer process.
This flag is set by tb_control() DOM0_TBUF_ENABLE with the condition of 
opt_tbuf_size > 0.

The trace buffer(tbuf_size) is allocated by is alloc_trace_bufs().
This function used by two functions(tb_set_size() and init_trace_bufs())
In tb_set_size(), the alloc_trace_bufs() failure is cared collectly by setting 
opt_tbuf_size=0.
But in init_trace_bufs(), the alloc_trace_bufs() failure is not cared collectry
(KEEP opt_tbuf_size = n ).
(init_trace_bufs() calls at x86/setup.c & ia64/xensetup.c)


This problem occured in following steps.
1)tbuf_size = n in xen boot option
2)tbuf_size is too large and memory allocation fails.
3)tbctl 1(TraceBuffer Enable tb_init_done set to 1.)
  (because opt_tbuf_size keeps n)
  (tbctl calls tb_control DOM0_TBUF_ENABLE)
  Current xen-unstable(CS10068), tbctl function is moved to get_tbuf(in 
xentrace & xenbaked)
  So 3) and 4) are occured at once.
  But Current xen-ia64-unstable(CS10029) still remain tbctl.

4)tracebuffer collection process start working
 (But trace buffer is not allocated)
5)tracebuffer collection process halted
  because no trace buffers,

To avoid this problem I changed the location of error collection code
opt_tbuf_size = 0;
from tb_set_size() to alloc_trace_bufs().
Because 1)allocation error is occured in alloc_trace_bufs() 
and     2)init_trace_bufs() mis-allocation is also cared.

Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>



Hi, All.

 This is a Patch for Trace Buffer allocation Error.
Currently, Trace Buffer Management users two variables
(opt_tbuf_size & tb_init_done)
Variable "opt_tbuf_size" is setting tbuf_size and keeps tbuf_size.

Variable "tb_init_done" is a flag to doing trace buffer process.
This flag is set by tb_control() DOM0_TBUF_ENABLE with opt_tbuf_size > 0.

Setting tbuf_size in memory is alloc_trace_bufs().
In tb_set_size(), the alloc_trace_bufs() failure is cared collectly 
opt_tbuf_size=0.
But in init_trace_bufs(), the alloc_trace_bufs() failure is not cared collectry
(KEEP opt_tbuf_size = n ).
(init_trace_bufs calls at x86/setup.c & ia64/xensetup.c)


This problem occured in following steps.
1)tbuf_size = n in xen boot option
2)tbuf_size is too large and memory allocation fails.
3)tbctl 1(TraceBuffer Enable tb_init_done set to 1.)
  (because opt_tbuf_size keeps n)
  (tbctl calls tb_control DOM0_TBUF_ENABLE)
4)tracebuffer collection process start working
 (But trace buffer is not allocated)
5)tracebuffer collection process halted
  because no trace buffers,

To avoid this problem I changed the location of error collection code
opt_tbuf_size = 0;
from tb_set_size() to alloc_trace_bufs().
Because 1)allocation error is occured in alloc_trace_bufs() 
and     2)init_trace_bufs() mis-allocation is also cared.

Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.