direct-io.hg

view tools/xentrace/setsize.c @ 11422:0419253c81de

Fix inverted sense of getRequiredAvailableMemory and
getRequiredInitialReservation on x86 HVM.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Sep 05 16:23:11 2006 +0100 (2006-09-05)
parents bc7d49df1651
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 }