All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Xentrace: Avoid Crash on Debug Build Xen
@ 2007-10-05  1:54 Yosuke Iwamatsu
  2007-10-05 16:21 ` Mark Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: Yosuke Iwamatsu @ 2007-10-05  1:54 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

Hi there,

Current xen-unstable (debug build) crashes when using xentrace command,
due to assertion failures. It seems assertion failures occur whenever
there exist lost records, and I don't see much reason to do this.
(Could anyone explain about these ASSERT lines ?)
The attached patch removes assertions to avoid system crashes,
and also fixes a mistake of an assignment statement.

Regards,
-------------------
Yosuke Iwamatsu
        NEC Corporation



[-- Attachment #2: xentrace_remove_assert.patch --]
[-- Type: text/plain, Size: 935 bytes --]

Xentrace: Remove assertions to avoid system crashes on debug build xen.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>

diff -r 2d761ca771fb xen/common/trace.c
--- a/xen/common/trace.c	Thu Oct 04 17:58:16 2007 +0100
+++ b/xen/common/trace.c	Fri Oct 05 10:28:33 2007 +0900
@@ -435,12 +435,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 +482,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);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Xentrace: Avoid Crash on Debug Build Xen
  2007-10-05  1:54 [PATCH] Xentrace: Avoid Crash on Debug Build Xen Yosuke Iwamatsu
@ 2007-10-05 16:21 ` Mark Williamson
  2007-10-09  1:47   ` Yosuke Iwamatsu
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Williamson @ 2007-10-05 16:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Yosuke Iwamatsu

Hi there,

diff -r 2d761ca771fb xen/common/trace.c
--- a/xen/common/trace.c        Thu Oct 04 17:58:16 2007 +0100
+++ b/xen/common/trace.c        Fri Oct 05 10:28:33 2007 +0900
@@ -435,12 +435,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;

Good catch!

         }
         total_size += LOST_REC_SIZE;
     }
-
-    ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf));
 
     if ( rec_size > bytes_to_wrap )
     {
@@ -484,8 +482,6 @@ void __trace_var(u32 event, int cycles, 
         insert_lost_records(buf);
     }
 
-    ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf));
-

> Current xen-unstable (debug build) crashes when using xentrace command,
> due to assertion failures. It seems assertion failures occur whenever
> there exist lost records, and I don't see much reason to do this.
> (Could anyone explain about these ASSERT lines ?)

These asserts appear to have originally been checking that bytes_to_wrap is 
being calculated correctly...  It looks to me that the first assert 
isoutdated though, because it clearly will fail if a record is lost.

Perhaps the second one ought to succed though, since the value of buf->prod 
will have been appropriately updated by insert_lost_records()?

Cheers,
Mark

> The attached patch removes assertions to avoid system crashes,
> and also fixes a mistake of an assignment statement.
>
> Regards,
> -------------------
> Yosuke Iwamatsu
>         NEC Corporation



-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Xentrace: Avoid Crash on Debug Build Xen
  2007-10-05 16:21 ` Mark Williamson
@ 2007-10-09  1:47   ` Yosuke Iwamatsu
  0 siblings, 0 replies; 3+ messages in thread
From: Yosuke Iwamatsu @ 2007-10-09  1:47 UTC (permalink / raw)
  To: Mark Williamson; +Cc: xen-devel

Mark Williamson wrote:
>          }
>          total_size += LOST_REC_SIZE;
>      }
> -
> -    ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf));
>  
>      if ( rec_size > bytes_to_wrap )
>      {
> @@ -484,8 +482,6 @@ void __trace_var(u32 event, int cycles, 
>          insert_lost_records(buf);
>      }
>  
> -    ASSERT(bytes_to_wrap == calc_bytes_to_wrap(buf));
> -
> 
>> Current xen-unstable (debug build) crashes when using xentrace command,
>> due to assertion failures. It seems assertion failures occur whenever
>> there exist lost records, and I don't see much reason to do this.
>> (Could anyone explain about these ASSERT lines ?)
> 
> These asserts appear to have originally been checking that bytes_to_wrap is 
> being calculated correctly...  It looks to me that the first assert 
> isoutdated though, because it clearly will fail if a record is lost.
> 
> Perhaps the second one ought to succed though, since the value of buf->prod 
> will have been appropriately updated by insert_lost_records()?

Indeed the second assert seems to always succeed.

> 
> Cheers,
> Mark
> 
>> The attached patch removes assertions to avoid system crashes,
>> and also fixes a mistake of an assignment statement.
>>
>> Regards,
>> -------------------
>> Yosuke Iwamatsu
>>         NEC Corporation
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-09  1:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-05  1:54 [PATCH] Xentrace: Avoid Crash on Debug Build Xen Yosuke Iwamatsu
2007-10-05 16:21 ` Mark Williamson
2007-10-09  1:47   ` Yosuke Iwamatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.