ia64/xen-unstable

view tools/xentrace/setsize.c @ 7778:0b4596caf761

nloopbacks default is now 8. So vifnum of greater than 7 requires
an adjustment to nloopbacks. Warning comment updated.

Signed-off-by: Nivedita Singhvi (niv@us.ibm.com)
author kaf24@firebug.cl.cam.ac.uk
date Fri Nov 11 10:46:36 2005 +0100 (2005-11-11)
parents f33f18fbf2cb
children 394390f6ff85
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 int size;
9 int xc_handle = xc_interface_open();
11 if (xc_tbuf_get_size(xc_handle, &size) != 0) {
12 perror("Failure to get tbuf info from Xen. Guess size is 0.");
13 printf("This may mean that tracing is not compiled into xen.\n");
14 exit(1);
15 }
16 else
17 printf("Current tbuf size: 0x%x\n", size);
19 if (argc < 2)
20 exit(0);
22 size = atoi(argv[1]);
24 if (xc_tbuf_set_size(xc_handle, size) != 0) {
25 perror("set_size Hypercall failure");
26 exit(1);
27 }
29 if (xc_tbuf_get_size(xc_handle, &size) != 0)
30 perror("Failure to get tbuf info from Xen. Guess size is 0.");
31 else
32 printf("New tbuf size: 0x%x\n", size);
34 xc_interface_close(xc_handle);
35 return 0;
36 }