diff options
author | George Dunlap <dunlapg@umich.edu> | 2006-08-21 12:05:11 -0400 |
---|---|---|
committer | George Dunlap <dunlapg@umich.edu> | 2006-08-21 12:05:11 -0400 |
commit | 9caa57d3c6711c54f07d8e17979893593f0d0cc8 (patch) | |
tree | 08a0fb56c889679c3fd777dde30436e29d07b177 /tools/xentrace/xentrace.c | |
parent | 8e12161aac5072940e35899b6a1c59afd0e6972b (diff) | |
download | xen-9caa57d3c6711c54f07d8e17979893593f0d0cc8.tar.gz xen-9caa57d3c6711c54f07d8e17979893593f0d0cc8.tar.bz2 xen-9caa57d3c6711c54f07d8e17979893593f0d0cc8.zip |
Added option to xentrace to set the trace buffer size.
Signed-off-by: George Dunlap <gdunlap@xensource.com>
Diffstat (limited to 'tools/xentrace/xentrace.c')
-rw-r--r-- | tools/xentrace/xentrace.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c index 17e76527d7..64327a6836 100644 --- a/tools/xentrace/xentrace.c +++ b/tools/xentrace/xentrace.c @@ -55,6 +55,7 @@ typedef struct settings_st { unsigned long new_data_thresh; uint32_t evt_mask; uint32_t cpu_mask; + unsigned long tbuf_size; } settings_t; settings_t opts; @@ -111,7 +112,10 @@ static void get_tbufs(unsigned long *mfn, unsigned long *size) exit(EXIT_FAILURE); } - ret = xc_tbuf_enable(xc_handle, DEFAULT_TBUF_SIZE, mfn, size); + if(!opts.tbuf_size) + opts.tbuf_size = DEFAULT_TBUF_SIZE; + + ret = xc_tbuf_enable(xc_handle, opts.tbuf_size, mfn, size); if ( ret != 0 ) { @@ -400,6 +404,15 @@ error_t cmd_parser(int key, char *arg, struct argp_state *state) } break; + case 'S': /* set tbuf size (given in pages) */ + { + char *inval; + setup->tbuf_size = strtol(arg, &inval, 0); + if ( inval == arg ) + argp_usage(state); + } + break; + case ARGP_KEY_ARG: { if ( state->arg_num == 0 ) @@ -439,6 +452,12 @@ const struct argp_option cmd_opts[] = .doc = "set evt-mask " }, + { .name = "trace-buf-size", .key='S', .arg="N", + .doc = + "Set trace buffer size in pages (default " xstr(DEFAULT_TBUF_SIZE) "). " + "N.B. that the trace buffer cannot be resized. If it has " + "already been set this boot cycle, this argument will be ignored." }, + {0} }; |