ia64/xen-unstable

view tools/xentrace/setsize.c @ 8740:3d7ea7972b39

Update patches for linux 2.6.15.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Feb 02 17:16:00 2006 +0000 (2006-02-02)
parents 394390f6ff85
children bc7d49df1651
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 enabled in 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 }
28 printf("set_size succeeded.\n");
30 if (xc_tbuf_get_size(xc_handle, &size) != 0)
31 perror("Failure to get tbuf info from Xen. Tracing must be enabled first");
32 else
33 printf("New tbuf size: 0x%x\n", size);
35 xc_interface_close(xc_handle);
36 return 0;
37 }