direct-io.hg

diff tools/libxc/xenctrl.h @ 7566:f33f18fbf2cb

This is a set of changes which allow the tracebuffer functionality to
be enabled and disabled dynamically while the system is running. The
existing DOM0_TBUFCONTROL hypercall is used, and three new operations
have been added: enable, disable, and set_size. This is to address
concerns that use of the trace buffers impacts system performance.

The initial value of opt_tbuf_size is set to zero, so that trace
buffers remain disabled by default. They can be enabled as they used
to be, by adding tbuf_size= to the xen command line at boot time. They
can also be turned on and off any time when the system is running. The
size of the trace buffer allocation can also be changed dynamically
while the system is running. The trace buffers may be completely
deallocated by setting the size to zero. No change in buffer size can
be done while tracing is enabled;

Other Changes made:
- Update the constants in tools/xentrace/formats to match those in
public/trace.h
- libxc functions for enable/disable, get/set size
Still left to do:
- remove all ifdef's for trace buffers and the 'trace' build option
- xm command to do enable/disable trace buffers and get/set size

Signed-off-by: Rob Gardner <rob.gardner@hp.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Oct 30 22:31:45 2005 +0100 (2005-10-30)
parents 8928c89a8d0a
children 8cc7ce549d00
line diff
     1.1 --- a/tools/libxc/xenctrl.h	Sun Oct 30 19:23:36 2005 +0100
     1.2 +++ b/tools/libxc/xenctrl.h	Sun Oct 30 22:31:45 2005 +0100
     1.3 @@ -149,7 +149,7 @@ int xc_domain_dumpcore(int xc_handle,
     1.4                         const char *corename);
     1.5  
     1.6  /*
     1.7 - * This function sets the maximum number vcpus that a domian may create.
     1.8 + * This function sets the maximum number of vcpus that a domain may create.
     1.9   *
    1.10   * @parm xc_handle a handle to an open hypervisor interface.
    1.11   * @parm domid the domain id in which vcpus are to be created.
    1.12 @@ -490,6 +490,47 @@ int xc_gnttab_dump_table(int        xc_h
    1.13  /* Get current total pages allocated to a domain. */
    1.14  long xc_get_tot_pages(int xc_handle, uint32_t domid);
    1.15  
    1.16 +
    1.17 +/*
    1.18 + * Trace Buffer Operations
    1.19 + */
    1.20 +
    1.21 +/**
    1.22 + * This function enables or disables tracing. Trace buffer memory must
    1.23 + * be already allocated by setting the size to a non-zero value, otherwise
    1.24 + * tracing cannot be enabled.
    1.25 + *
    1.26 + * @parm xc_handle a handle to an open hypervisor interface
    1.27 + * @parm enable the desired action, 1 for enable, 0 for disable
    1.28 + * @return 0 on success, -1 on failure.
    1.29 + */
    1.30 +int xc_tbuf_enable(int xc_handle, int enable);
    1.31 +
    1.32 +/**
    1.33 + * This function sets the size of the trace buffers. Setting it to zero
    1.34 + * deallocates the memory used for trace buffers, and setting it to a
    1.35 + * non-zero value specifies the number of pages per cpu to allocate.
    1.36 + * To change the size of an existing allocation, you must first deallocate
    1.37 + * it then reallocate it. No change in size is allowed when tracing is
    1.38 + * enabled; A disable call must be made first.
    1.39 + *
    1.40 + * @parm xc_handle a handle to an open hypervisor interface
    1.41 + * @parm size the size in pages per cpu for the trace buffers
    1.42 + * @return 0 on success, -1 on failure.
    1.43 + */
    1.44 +int xc_tbuf_set_size(int xc_handle, uint32_t size);
    1.45 +
    1.46 +/**
    1.47 + * This function retrieves the current size of the trace buffers. 
    1.48 + * Note that the size returned is in terms of bytes, not pages.
    1.49 +
    1.50 + * @parm xc_handle a handle to an open hypervisor interface
    1.51 + * @parm size will contain the size in bytes for the trace buffers
    1.52 + * @return 0 on success, -1 on failure.
    1.53 + */
    1.54 +int xc_tbuf_get_size(int xc_handle, uint32_t *size);
    1.55 +
    1.56 +
    1.57  /* Execute a privileged dom0 operation. */
    1.58  int xc_dom0_op(int xc_handle, dom0_op_t *op);
    1.59