diff options
-rw-r--r-- | tools/libxc/xenctrl.h | 1 | ||||
-rw-r--r-- | tools/xentrace/Makefile | 2 | ||||
-rw-r--r-- | tools/xentrace/setsize.c | 52 |
3 files changed, 30 insertions, 25 deletions
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index 7e658c16c6..abb0230d53 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -9,6 +9,7 @@ #ifndef XENCTRL_H #define XENCTRL_H +#include <stddef.h> #include <stdint.h> #include <sys/ptrace.h> #include <xen/xen.h> diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile index f7f8ac1969..0bebd5eea7 100644 --- a/tools/xentrace/Makefile +++ b/tools/xentrace/Makefile @@ -14,7 +14,7 @@ CFLAGS += -I $(XEN_LIBXC) HDRS = $(wildcard *.h) OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) -BIN = xentrace tbctl setsize +BIN = xentrace setsize LIBBIN = SCRIPTS = xentrace_format MAN1 = $(wildcard *.1) diff --git a/tools/xentrace/setsize.c b/tools/xentrace/setsize.c index e13ea173ee..fcb1fcb6b0 100644 --- a/tools/xentrace/setsize.c +++ b/tools/xentrace/setsize.c @@ -5,33 +5,37 @@ int main(int argc, char * argv[]) { - unsigned int size; - int xc_handle = xc_interface_open(); + unsigned long size; + int xc_handle = xc_interface_open(); - if (xc_tbuf_get_size(xc_handle, &size) != 0) { - perror("Failure to get tbuf info from Xen. Guess size is 0"); - printf("This may mean that tracing is not enabled in xen.\n"); - // exit(1); - } - else - printf("Current tbuf size: 0x%x\n", size); - - if (argc < 2) - exit(0); + if ( xc_tbuf_get_size(xc_handle, &size) != 0 ) + { + perror("Failure to get tbuf info from Xen. Guess size is 0"); + printf("This may mean that tracing is not enabled in xen.\n"); + } + else + { + printf("Current tbuf size: 0x%lx\n", size); + } + + if (argc < 2) + exit(0); - size = atoi(argv[1]); + size = atol(argv[1]); - if (xc_tbuf_set_size(xc_handle, size) != 0) { - perror("set_size Hypercall failure"); - exit(1); - } - printf("set_size succeeded.\n"); + if ( xc_tbuf_set_size(xc_handle, size) != 0 ) + { + perror("set_size Hypercall failure"); + exit(1); + } + printf("set_size succeeded.\n"); - if (xc_tbuf_get_size(xc_handle, &size) != 0) - perror("Failure to get tbuf info from Xen. Tracing must be enabled first"); - else - printf("New tbuf size: 0x%x\n", size); + if (xc_tbuf_get_size(xc_handle, &size) != 0) + perror("Failure to get tbuf info from Xen." + " Tracing must be enabled first"); + else + printf("New tbuf size: 0x%lx\n", size); - xc_interface_close(xc_handle); - return 0; + xc_interface_close(xc_handle); + return 0; } |