Files
xen/tools/xentrace/setsize.c
T
kaf24@firebug.cl.cam.ac.uk dbb16ea9d1 Fix the tools build:
1. xenctrl.h needs to include stddef.h to define size_t
 2. tbctl is broken -- remove it since xenmon and xentrace
    both automatcially enable tracing now
 3. Fix setsize after xc_tbug interface changes

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-16 13:35:59 +01:00

42 lines
952 B
C

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <xenctrl.h>
int main(int argc, char * argv[])
{
unsigned long size;
int xc_handle = xc_interface_open();
if ( xc_tbuf_get_size(xc_handle, &size) != 0 )
{
perror("Failure to get tbuf info from Xen. Guess size is 0");
printf("This may mean that tracing is not enabled in xen.\n");
}
else
{
printf("Current tbuf size: 0x%lx\n", size);
}
if (argc < 2)
exit(0);
size = atol(argv[1]);
if ( xc_tbuf_set_size(xc_handle, size) != 0 )
{
perror("set_size Hypercall failure");
exit(1);
}
printf("set_size succeeded.\n");
if (xc_tbuf_get_size(xc_handle, &size) != 0)
perror("Failure to get tbuf info from Xen."
" Tracing must be enabled first");
else
printf("New tbuf size: 0x%lx\n", size);
xc_interface_close(xc_handle);
return 0;
}