ia64/xen-unstable

view tools/xentrace/setsize.c @ 10067:bc7d49df1651

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>
author kaf24@firebug.cl.cam.ac.uk
date Tue May 16 13:35:59 2006 +0100 (2006-05-16)
parents 394390f6ff85
children
line source
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <errno.h>
4 #include <xenctrl.h>
6 int main(int argc, char * argv[])
7 {
8 unsigned long size;
9 int xc_handle = xc_interface_open();
11 if ( xc_tbuf_get_size(xc_handle, &size) != 0 )
12 {
13 perror("Failure to get tbuf info from Xen. Guess size is 0");
14 printf("This may mean that tracing is not enabled in xen.\n");
15 }
16 else
17 {
18 printf("Current tbuf size: 0x%lx\n", size);
19 }
21 if (argc < 2)
22 exit(0);
24 size = atol(argv[1]);
26 if ( xc_tbuf_set_size(xc_handle, size) != 0 )
27 {
28 perror("set_size Hypercall failure");
29 exit(1);
30 }
31 printf("set_size succeeded.\n");
33 if (xc_tbuf_get_size(xc_handle, &size) != 0)
34 perror("Failure to get tbuf info from Xen."
35 " Tracing must be enabled first");
36 else
37 printf("New tbuf size: 0x%lx\n", size);
39 xc_interface_close(xc_handle);
40 return 0;
41 }