ia64/xen-unstable

changeset 16073:1d120f6807ba

entrace: Remove assertions to avoid system crashes on debug build xen.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
author Keir Fraser <keir@xensource.com>
date Fri Oct 05 10:38:52 2007 +0100 (2007-10-05)
parents b629d7a2bcc7
children 61ef23e45e9c
files xen/common/trace.c
line diff
     1.1 --- a/xen/common/trace.c	Fri Oct 05 10:31:25 2007 +0100
     1.2 +++ b/xen/common/trace.c	Fri Oct 05 10:38:52 2007 +0100
     1.3 @@ -360,21 +360,15 @@ void __trace_var(u32 event, int cycles, 
     1.4      int extra_word;
     1.5      int started_below_highwater;
     1.6  
     1.7 -    if(!tb_init_done)
     1.8 -        return;
     1.9 +    ASSERT(tb_init_done);
    1.10  
    1.11      /* Convert byte count into word count, rounding up */
    1.12      extra_word = (extra / sizeof(u32));
    1.13 -    if((extra % sizeof(u32)) != 0)
    1.14 +    if ( (extra % sizeof(u32)) != 0 )
    1.15          extra_word++;
    1.16      
    1.17 -#if !NDEBUG
    1.18 -    ASSERT(extra_word<=TRACE_EXTRA_MAX);
    1.19 -#else
    1.20 -    /* Not worth crashing a production system over */
    1.21 -    if(extra_word > TRACE_EXTRA_MAX)
    1.22 -        extra_word = TRACE_EXTRA_MAX;
    1.23 -#endif
    1.24 +    ASSERT(extra_word <= TRACE_EXTRA_MAX);
    1.25 +    extra_word = min_t(int, extra_word, TRACE_EXTRA_MAX);
    1.26  
    1.27      /* Round size up to nearest word */
    1.28      extra = extra_word * sizeof(u32);
    1.29 @@ -401,7 +395,7 @@ void __trace_var(u32 event, int cycles, 
    1.30  
    1.31      local_irq_save(flags);
    1.32  
    1.33 -    started_below_highwater = ( (buf->prod - buf->cons) < t_buf_highwater );
    1.34 +    started_below_highwater = ((buf->prod - buf->cons) < t_buf_highwater);
    1.35  
    1.36      /* Calculate the record size */
    1.37      rec_size = calc_rec_size(cycles, extra);
    1.38 @@ -435,13 +429,11 @@ void __trace_var(u32 event, int cycles, 
    1.39          {
    1.40              bytes_to_wrap -= LOST_REC_SIZE;
    1.41              if ( bytes_to_wrap == 0 )
    1.42 -                bytes_to_wrap == data_size;
    1.43 +                bytes_to_wrap = data_size;
    1.44          }
    1.45          total_size += LOST_REC_SIZE;
    1.46      }
    1.47  
    1.48 -    ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf));
    1.49 -
    1.50      if ( rec_size > bytes_to_wrap )
    1.51      {
    1.52          total_size += bytes_to_wrap;
    1.53 @@ -484,8 +476,6 @@ void __trace_var(u32 event, int cycles, 
    1.54          insert_lost_records(buf);
    1.55      }
    1.56  
    1.57 -    ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf));
    1.58 -
    1.59      if ( rec_size > bytes_to_wrap )
    1.60          insert_wrap_record(buf, rec_size);
    1.61