Skip to contentSkip to conversation

Fix xc_tbuf_enable assumption.

PATCH New Atsushi SAKAI 1 participant 1 message May 24, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix xc_tbuf_enable assumption.

Hi, All!

This is a patch which needs discussion.

Currently xc_tbuf_enable assumed tb_init_done = 0.
But Sometimes already on

For example(xenmon.py(xenbaked) and xentrace). These two programs assues tb_init_done =0 at start time.

Currently xenbaked care the problem by setting tb_init_done=0 at exit time. But xentrace does not care the problem.
Then error occured!(Cannot see the trace buffer.)

I added a code in xc_tbuf_enable to permit tb_init_done=1. And I added to check trace buffer region is already allocated or not by using xc_tbuf_get_size.

But This solution problem remains,
1) It cannot change the trace buffer size by using xc_tbuf_enable If we do, we need to add more code to freeing xen buffer.

As other option.(at application layer)
Adding previous command tbctl.
This command switches tb_init_done =0 and 1.

Comments are appreciated.

This problem occured in following steps.

1)xentrace
tb_init_done = 1
2)xentrace (problem occured at xc_tbuf_enable see above)

After xentrace work, this problem occured.

Thanks,
Atsushi Sakai

tools/libxc/xc_tbuf.c +2 -2
diff -r f0f88d9c4c9e tools/libxc/xc_tbuf.c
@@ -63,8 +63,8 @@ int xc_tbuf_enable(int xc_handle, size_t
     DECLARE_DOM0_OP;
     int rc;
 
-    if ( xc_tbuf_set_size(xc_handle, cnt) != 0 )
-        return -1;
+    if ( xc_tbuf_get_size(xc_handle, size) != 0 )
+        xc_tbuf_set_size(xc_handle, cnt);
 
     if ( tbuf_enable(xc_handle, 1) != 0 )
         return -1;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel