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-devel

[Xen-devel] Re: [Xen-changelog] Fix xentrace to initialise the trace buf

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [Xen-changelog] Fix xentrace to initialise the trace buffers if they are not set up.
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Mon, 15 May 2006 17:19:15 +0100
Cc: sakaia@xxxxxxxxxxxxxx
Delivery-date: Mon, 15 May 2006 09:19:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <E1FfNdJ-0005Qn-Hd@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E1FfNdJ-0005Qn-Hd@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Sun, May 14, 2006 at 08:56:08PM +0000, Atsushi SAKAI wrote:

> Fix xentrace to initialise the trace buffers if they are not set up.
> Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>

> +#include "xc_private.h"

Please don't do this. It's called "xc_private.h" for a reason.

> +    int ret;
> +    dom0_op_t op;                        /* dom0 op we'll build             
> */
>      int xc_handle = xc_interface_open(); /* for accessing control interface 
> */
> -
> -    if (xc_tbuf_get_size(xc_handle, &size32) != 0)
> -        goto fail;
> -    *size = size32;
> -
> -    if (xc_tbuf_get_mfn(xc_handle, mfn) != 0)
> -        goto fail;
> +    unsigned int tbsize;
> +
> +    enable_tracing_or_die(xc_handle);
> +
> +    if (xc_tbuf_get_size(xc_handle, &tbsize) != 0) {
> +      perror("Failure to get tbuf info from Xen. Guess size is 0?");
> +      exit(1);
> +    }
> +    else
> +      printf("Current tbuf size: 0x%x\n", tbsize);
> +    
> +
> +    op.cmd = DOM0_TBUFCONTROL;
> +    op.interface_version = DOM0_INTERFACE_VERSION;
> +    op.u.tbufcontrol.op  = DOM0_TBUF_GET_INFO;
> +
> +    ret = do_dom0_op(xc_handle, &op);

In particular, don't do this. Only libbxc/xc_tbuf.c can include
xc_private.h. Why have you re-introduced this? Can you fix it back up
please to use get_size/get_mfn()?

thanks,
john

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