debuggers.hg
changeset 11256:f681ffc9b01a
Added option to xentrace to set the trace buffer size.
Signed-off-by: George Dunlap <gdunlap@xensource.com>
Signed-off-by: George Dunlap <gdunlap@xensource.com>
author | George Dunlap <dunlapg@umich.edu> |
---|---|
date | Mon Aug 21 12:05:11 2006 -0400 (2006-08-21) |
parents | 6a8204e4619d |
children | 80c5350a68f1 a58ffedb59ce |
files | tools/xentrace/xentrace.c |
line diff
1.1 --- a/tools/xentrace/xentrace.c Mon Aug 21 13:36:05 2006 +0100 1.2 +++ b/tools/xentrace/xentrace.c Mon Aug 21 12:05:11 2006 -0400 1.3 @@ -55,6 +55,7 @@ typedef struct settings_st { 1.4 unsigned long new_data_thresh; 1.5 uint32_t evt_mask; 1.6 uint32_t cpu_mask; 1.7 + unsigned long tbuf_size; 1.8 } settings_t; 1.9 1.10 settings_t opts; 1.11 @@ -111,7 +112,10 @@ static void get_tbufs(unsigned long *mfn 1.12 exit(EXIT_FAILURE); 1.13 } 1.14 1.15 - ret = xc_tbuf_enable(xc_handle, DEFAULT_TBUF_SIZE, mfn, size); 1.16 + if(!opts.tbuf_size) 1.17 + opts.tbuf_size = DEFAULT_TBUF_SIZE; 1.18 + 1.19 + ret = xc_tbuf_enable(xc_handle, opts.tbuf_size, mfn, size); 1.20 1.21 if ( ret != 0 ) 1.22 { 1.23 @@ -400,6 +404,15 @@ error_t cmd_parser(int key, char *arg, s 1.24 } 1.25 break; 1.26 1.27 + case 'S': /* set tbuf size (given in pages) */ 1.28 + { 1.29 + char *inval; 1.30 + setup->tbuf_size = strtol(arg, &inval, 0); 1.31 + if ( inval == arg ) 1.32 + argp_usage(state); 1.33 + } 1.34 + break; 1.35 + 1.36 case ARGP_KEY_ARG: 1.37 { 1.38 if ( state->arg_num == 0 ) 1.39 @@ -439,6 +452,12 @@ const struct argp_option cmd_opts[] = 1.40 .doc = 1.41 "set evt-mask " }, 1.42 1.43 + { .name = "trace-buf-size", .key='S', .arg="N", 1.44 + .doc = 1.45 + "Set trace buffer size in pages (default " xstr(DEFAULT_TBUF_SIZE) "). " 1.46 + "N.B. that the trace buffer cannot be resized. If it has " 1.47 + "already been set this boot cycle, this argument will be ignored." }, 1.48 + 1.49 {0} 1.50 }; 1.51