debuggers.hg

view tools/xentrace/setsize.c @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
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 }