mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
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>
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
/******************************************************************************
|
|
* xc_tbuf.c
|
|
*
|
|
* API for manipulating and accessing trace buffer parameters
|
|
*
|
|
* Copyright (c) 2005, Rob Gardner
|
|
*/
|
|
|
|
#include "xc_private.h"
|
|
|
|
int xc_tbuf_enable(int xc_handle, int enable)
|
|
{
|
|
dom0_op_t op;
|
|
|
|
op.cmd = DOM0_TBUFCONTROL;
|
|
op.interface_version = DOM0_INTERFACE_VERSION;
|
|
if (enable)
|
|
op.u.tbufcontrol.op = DOM0_TBUF_ENABLE;
|
|
else
|
|
op.u.tbufcontrol.op = DOM0_TBUF_DISABLE;
|
|
|
|
return xc_dom0_op(xc_handle, &op);
|
|
}
|
|
|
|
int xc_tbuf_set_size(int xc_handle, uint32_t size)
|
|
{
|
|
dom0_op_t op;
|
|
|
|
op.cmd = DOM0_TBUFCONTROL;
|
|
op.interface_version = DOM0_INTERFACE_VERSION;
|
|
op.u.tbufcontrol.op = DOM0_TBUF_SET_SIZE;
|
|
op.u.tbufcontrol.size = size;
|
|
|
|
return xc_dom0_op(xc_handle, &op);
|
|
}
|
|
|
|
int xc_tbuf_get_size(int xc_handle, uint32_t *size)
|
|
{
|
|
int rc;
|
|
dom0_op_t op;
|
|
|
|
op.cmd = DOM0_TBUFCONTROL;
|
|
op.interface_version = DOM0_INTERFACE_VERSION;
|
|
op.u.tbufcontrol.op = DOM0_TBUF_GET_INFO;
|
|
|
|
rc = xc_dom0_op(xc_handle, &op);
|
|
if (rc == 0)
|
|
*size = op.u.tbufcontrol.size;
|
|
return rc;
|
|
}
|
|
|