diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-16 13:35:59 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-05-16 13:35:59 +0100 |
commit | dbb16ea9d1eb93191b8b614a892f453450d8ff74 (patch) | |
tree | 365d9ec9312b1884fe8083289092129c269d4f95 /tools/xentrace/setsize.c | |
parent | 4eabcb748c606ee33da37c5d874efb29a18f859a (diff) | |
download | xen-dbb16ea9d1eb93191b8b614a892f453450d8ff74.tar.gz xen-dbb16ea9d1eb93191b8b614a892f453450d8ff74.tar.bz2 xen-dbb16ea9d1eb93191b8b614a892f453450d8ff74.zip |
Fix the tools build:
1. xenctrl.h needs to include stddef.h to define size_t
2. tbctl is broken -- remove it since xenmon and xentrace
both automatcially enable tracing now
3. Fix setsize after xc_tbug interface changes
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xentrace/setsize.c')
-rw-r--r-- | tools/xentrace/setsize.c | 52 |
1 files changed, 28 insertions, 24 deletions
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; } |