mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +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>
27 lines
547 B
C
27 lines
547 B
C
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <xenctrl.h>
|
|
|
|
int main(int argc, char * argv[])
|
|
{
|
|
int enable;
|
|
int xc_handle = xc_interface_open();
|
|
|
|
if (argc < 2) {
|
|
printf("usage: %s [0|1]\n", argv[0]);
|
|
exit(1);
|
|
}
|
|
enable = atoi(argv[1]);
|
|
|
|
if (xc_tbuf_enable(xc_handle, enable) != 0) {
|
|
perror("Enable/Disable Hypercall failure");
|
|
exit(1);
|
|
}
|
|
else
|
|
printf("Tracing now %s\n", (enable ? "enabled" : "disabled"));
|
|
|
|
xc_interface_close(xc_handle);
|
|
return 0;
|
|
}
|