WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] entrace: Remove assertions to avoid syste

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] entrace: Remove assertions to avoid system crashes on debug build xen.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 05 Oct 2007 08:40:08 -0700
Delivery-date: Fri, 05 Oct 2007 08:40:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1191577132 -3600
# Node ID 1d120f6807bacf4b77faafae8efa42f0eb535e2c
# Parent  b629d7a2bcc71370b104a89e585e7f850c9cd224
entrace: Remove assertions to avoid system crashes on debug build xen.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>
---
 xen/common/trace.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff -r b629d7a2bcc7 -r 1d120f6807ba xen/common/trace.c
--- a/xen/common/trace.c        Fri Oct 05 10:31:25 2007 +0100
+++ b/xen/common/trace.c        Fri Oct 05 10:38:52 2007 +0100
@@ -360,21 +360,15 @@ void __trace_var(u32 event, int cycles, 
     int extra_word;
     int started_below_highwater;
 
-    if(!tb_init_done)
-        return;
+    ASSERT(tb_init_done);
 
     /* Convert byte count into word count, rounding up */
     extra_word = (extra / sizeof(u32));
-    if((extra % sizeof(u32)) != 0)
+    if ( (extra % sizeof(u32)) != 0 )
         extra_word++;
     
-#if !NDEBUG
-    ASSERT(extra_word<=TRACE_EXTRA_MAX);
-#else
-    /* Not worth crashing a production system over */
-    if(extra_word > TRACE_EXTRA_MAX)
-        extra_word = TRACE_EXTRA_MAX;
-#endif
+    ASSERT(extra_word <= TRACE_EXTRA_MAX);
+    extra_word = min_t(int, extra_word, TRACE_EXTRA_MAX);
 
     /* Round size up to nearest word */
     extra = extra_word * sizeof(u32);
@@ -401,7 +395,7 @@ void __trace_var(u32 event, int cycles, 
 
     local_irq_save(flags);
 
-    started_below_highwater = ( (buf->prod - buf->cons) < t_buf_highwater );
+    started_below_highwater = ((buf->prod - buf->cons) < t_buf_highwater);
 
     /* Calculate the record size */
     rec_size = calc_rec_size(cycles, extra);
@@ -435,12 +429,10 @@ void __trace_var(u32 event, int cycles, 
         {
             bytes_to_wrap -= LOST_REC_SIZE;
             if ( bytes_to_wrap == 0 )
-                bytes_to_wrap == data_size;
+                bytes_to_wrap = data_size;
         }
         total_size += LOST_REC_SIZE;
     }
-
-    ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf));
 
     if ( rec_size > bytes_to_wrap )
     {
@@ -484,8 +476,6 @@ void __trace_var(u32 event, int cycles, 
         insert_lost_records(buf);
     }
 
-    ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf));
-
     if ( rec_size > bytes_to_wrap )
         insert_wrap_record(buf, rec_size);
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] entrace: Remove assertions to avoid system crashes on debug build xen., Xen patchbot-unstable <=