* [PATCH 0 of 3] xentrace updates
@ 2010-04-13 16:52 George Dunlap
2010-04-13 16:52 ` [PATCH 1 of 3] xentrace: Skip to low cpu when throwing away portions of the circular buffer George Dunlap
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: George Dunlap @ 2010-04-13 16:52 UTC (permalink / raw)
To: xen-devel; +Cc: george.dunlap
Some minor updates to xentrace.
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1 of 3] xentrace: Skip to low cpu when throwing away portions of the circular buffer 2010-04-13 16:52 [PATCH 0 of 3] xentrace updates George Dunlap @ 2010-04-13 16:52 ` George Dunlap 2010-04-13 16:52 ` [PATCH 2 of 3] xentrace: Add an option not to enable tracing George Dunlap 2010-04-13 16:53 ` [PATCH 3 of 3] xentrace: Add missing help option George Dunlap 2 siblings, 0 replies; 5+ messages in thread From: George Dunlap @ 2010-04-13 16:52 UTC (permalink / raw) To: xen-devel; +Cc: george.dunlap Skip to the next "low" cpu when throwing away portions of the circular memory buffer. This makes subsequent analysis easier. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> diff -r 859a372efa66 -r 16ef34de0129 tools/xentrace/xentrace.c --- a/tools/xentrace/xentrace.c Tue Apr 13 13:40:58 2010 +0100 +++ b/tools/xentrace/xentrace.c Tue Apr 13 17:24:07 2010 +0100 @@ -149,6 +149,7 @@ { struct cpu_change_record *rec; long need_to_consume, free, freed; + int last_cpu = -1; if ( membuf.pending_size > 0 ) { @@ -193,11 +194,25 @@ if ( need_to_consume > 0 ) { + last_cpu = rec->data.cpu; MEMBUF_CONS_INCREMENT(freed); need_to_consume -= freed; } } while( need_to_consume > 0 ); + /* For good tsc consistency, we need to start at a low-cpu buffer. Keep + * skipping until the cpu goes down or stays the same. */ + rec = (struct cpu_change_record *)MEMBUF_POINTER(membuf.cons); + while ( rec->data.cpu > last_cpu ) + { + last_cpu = rec->data.cpu; + + freed = sizeof(*rec) + rec->data.window_size; + + MEMBUF_CONS_INCREMENT(freed); + rec = (struct cpu_change_record *)MEMBUF_POINTER(membuf.cons); + } + start_window: /* * Start writing "pending" data. Update prod once all this data is ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2 of 3] xentrace: Add an option not to enable tracing 2010-04-13 16:52 [PATCH 0 of 3] xentrace updates George Dunlap 2010-04-13 16:52 ` [PATCH 1 of 3] xentrace: Skip to low cpu when throwing away portions of the circular buffer George Dunlap @ 2010-04-13 16:52 ` George Dunlap 2010-04-13 16:53 ` [PATCH 3 of 3] xentrace: Add missing help option George Dunlap 2 siblings, 0 replies; 5+ messages in thread From: George Dunlap @ 2010-04-13 16:52 UTC (permalink / raw) To: xen-devel; +Cc: george.dunlap Add an option that will set up the buffers and listen for updates, but will not enable tracing. This is useful if you have hacks in Xen to enable tracing at key points (for example, debugging a shadow bug). Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> diff -r 16ef34de0129 -r ce0812566a4d tools/xentrace/xentrace.c --- a/tools/xentrace/xentrace.c Tue Apr 13 17:24:07 2010 +0100 +++ b/tools/xentrace/xentrace.c Tue Apr 13 17:24:08 2010 +0100 @@ -58,7 +58,8 @@ unsigned long timeout; unsigned long memory_buffer; uint8_t discard:1, - disable_tracing:1; + disable_tracing:1, + start_disabled:1; } settings_t; struct t_struct { @@ -659,6 +660,10 @@ /* setup access to trace buffers */ get_tbufs(&tbufs_mfn, &tinfo_size); + + if ( opts.start_disabled ) + disable_tbufs(); + tbufs = map_tbufs(tbufs_mfn, num, tinfo_size); size = tbufs->t_info->tbuf_size * XC_PAGE_SIZE; @@ -791,6 +796,9 @@ " it exits. Selecting this option will tell it to\n" \ " keep tracing on. Traces will be collected in\n" \ " Xen's trace buffers until they become full.\n" \ +" -X --start-disabled Setup trace buffers and listen, but don't enable\n" \ +" tracing. (Useful if tracing will be enabled by\n" \ +" else.)\n" \ " -T --time-interval=s Run xentrace for s seconds and quit.\n" \ " -?, --help Show this message\n" \ " -V, --version Print program version\n" \ @@ -914,12 +922,13 @@ { "memory-buffer", required_argument, 0, 'M' }, { "discard-buffers", no_argument, 0, 'D' }, { "dont-disable-tracing", no_argument, 0, 'x' }, + { "start-disabled", no_argument, 0, 'X' }, { "help", no_argument, 0, '?' }, { "version", no_argument, 0, 'V' }, { 0, 0, 0, 0 } }; - while ( (option = getopt_long(argc, argv, "t:s:c:e:S:r:T:M:Dx?V", + while ( (option = getopt_long(argc, argv, "t:s:c:e:S:r:T:M:DxX?V", long_options, NULL)) != -1) { switch ( option ) @@ -957,6 +966,10 @@ opts.disable_tracing = 0; break; + case 'X': /* Start disabled */ + opts.start_disabled = 1; + break; + case 'T': opts.timeout = argtol(optarg, 0); break; @@ -993,6 +1006,7 @@ opts.cpu_mask = 0; opts.disk_rsvd = 0; opts.disable_tracing = 1; + opts.start_disabled = 0; opts.timeout = 0; parse_args(argc, argv); ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3 of 3] xentrace: Add missing help option 2010-04-13 16:52 [PATCH 0 of 3] xentrace updates George Dunlap 2010-04-13 16:52 ` [PATCH 1 of 3] xentrace: Skip to low cpu when throwing away portions of the circular buffer George Dunlap 2010-04-13 16:52 ` [PATCH 2 of 3] xentrace: Add an option not to enable tracing George Dunlap @ 2010-04-13 16:53 ` George Dunlap 2 siblings, 0 replies; 5+ messages in thread From: George Dunlap @ 2010-04-13 16:53 UTC (permalink / raw) To: xen-devel; +Cc: george.dunlap Describe the --reserve-disk-space option in the xentrace help. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> diff -r ce0812566a4d -r a0d521070853 tools/xentrace/xentrace.c --- a/tools/xentrace/xentrace.c Tue Apr 13 17:24:08 2010 +0100 +++ b/tools/xentrace/xentrace.c Tue Apr 13 17:24:08 2010 +0100 @@ -804,6 +804,9 @@ " -V, --version Print program version\n" \ " -M, --memory-buffer=b Copy trace records to a circular memory buffer.\n" \ " Dump to file on exit.\n" \ +" -r --reserve-disk-space=n Before writing trace records to disk, check to see\n" \ +" that after the write there will be at least n space\n" \ +" left on the disk.\n" \ "\n" \ "This tool is used to capture trace buffer data from Xen. The\n" \ "data is output in a binary format, in the following order:\n" \ ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0 of 3] xentrace updates @ 2011-03-30 18:04 Olaf Hering 0 siblings, 0 replies; 5+ messages in thread From: Olaf Hering @ 2011-03-30 18:04 UTC (permalink / raw) To: xen-devel; +Cc: George Dunlap Three more minor corrections to trace.c. The formula used the already calculated offset of the array for multiplication, and the max number of pages per cpu could wrap. However, its not possible to allocate the MAX_ORDER (which is 9 on x86) for each cpu (just for verification) on a box with 8 cpus. If booted with tbuf_size=8192 alloc fails on the 4th cpu, at runtime already on the second. What is the reason for that, which pool of pages is too small? Olaf ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-30 18:04 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-04-13 16:52 [PATCH 0 of 3] xentrace updates George Dunlap 2010-04-13 16:52 ` [PATCH 1 of 3] xentrace: Skip to low cpu when throwing away portions of the circular buffer George Dunlap 2010-04-13 16:52 ` [PATCH 2 of 3] xentrace: Add an option not to enable tracing George Dunlap 2010-04-13 16:53 ` [PATCH 3 of 3] xentrace: Add missing help option George Dunlap -- strict thread matches above, loose matches on Subject: below -- 2011-03-30 18:04 [PATCH 0 of 3] xentrace updates Olaf Hering
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.