Skip to contentSkip to conversation

Announcement: xenalyze trace analysis tool released

DISCUSSION George Dunlap 3 participants 4 messages Aug 13, 2009 – Apr 30, 2010

lore
Share & tools
lore
#0 lore raw

I am pleased to announce the public availability of xenalyze, a tool I've developed over the last 2+ years to analyze the output of xentrace.

Mercurial repository is available at
http://xenbits.xensource.com/ext/xenalyze.hg

Xenalyze is a tool I've developed while doing performance analysis for XenSource and Citrix. Features include:
* Orders trace records across physical cpus by tsc. Attempts to automatically detect and adjust for tsc skew.
* Tracks domains and vcpus across pcpus, to collect information about VMs, not processors
* Statistical information about particular events or states generally includes:
+ Total time across the run
+ Percentage of time spent
+ Average number of cycles for an event
+ 5th, 50th, and 95th percentiles of a sample of events
* Statistical data collection includes:
+ Scheduler runstates: running, runnable, blocked, offline
+ Time spent in VMEXITs (i.e., from VMEXIT to VMENTER)
- Includes time spent doing emulation for specific
- Optionally includes time spent for particular MMIO / IO addresses
+ Time spent running on physical processors before being migrated
+ Optional tracking of guest cr3 values (generally corresponding to
guest processes)
* "Dump" mode, which will dump a human-readable format of the trace in the order the events were generated
* Optional "symbol file" which will symbolically interpret guest EIPs
* "Interval" mode, which allows you to graph data over time
" Varous "scatterplot" modes, which allow you to visualize data such as guest EIP values
* Deals gracefully with lost records.
* Graphical progress bar and completion pop-up for long traces

There is some minimal documentation in a file called xenalyze.html, and back-patches to work with earlier versions of Xen in the directory called back-patches/.

Questions, comments and patches welcome. The tool is doubtless rather quirky, as I'm both the main developer and user.

Enjoy,
-George Dunlap

#1 lore raw

Hi, George

It's interesting tool.
I got many error on x86_64 dom0 while compiling. The patch fixes these.

gcc -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs -Werror -o xenalyze xenalyze.c
cc1: warnings being treated as errors
xenalyze.c: In function 'init_hvm_data':
xenalyze.c:1321: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
xenalyze.c: In function 'hvm_msr_write_process':
xenalyze.c:4055: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'hvm_msr_read_process':
xenalyze.c:4104: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'shadow_emulate_process':
xenalyze.c:5128: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5142: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5156: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'shadow_parse_other':
xenalyze.c:5228: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5244: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5256: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'shadow_fixup_process':
xenalyze.c:5445: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5458: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5471: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'shadow_mmio_process':
xenalyze.c:5559: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5570: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'vcpu_create':
xenalyze.c:6080: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'domain_create':
xenalyze.c:6122: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'scan_for_new_pcpu':
xenalyze.c:7119: warning: format '%lld' expects type 'long long int', but argument 5 has type 'loff_t'
xenalyze.c: In function 'process_cpu_change':
xenalyze.c:7194: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'loff_t'
xenalyze.c:7194: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'loff_t'
xenalyze.c:7220: warning: format '%lld' expects type 'long long int', but argument 5 has type 'loff_t'
xenalyze.c:7245: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'loff_t'
xenalyze.c: In function '__read_record':
xenalyze.c:7538: warning: format '%d' expects type 'int', but argument 4 has type 'ssize_t'
xenalyze.c:7547: warning: format '%d' expects type 'int', but argument 4 has type 'ssize_t'
xenalyze.c:7547: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t'
xenalyze.c: In function '__fill_in_record_info':
xenalyze.c:7594: warning: format '%016llx' expects type 'long long unsigned int', but argument 3 has type 'loff_t'
make: *** [xenalyze] Error 1

Best Regards,

Akio Takebe

dump-raw.c +4 -4
diff -r 46d869f585a1 dump-raw.c
@@ -94,7 +94,7 @@
         return 0;
     } else if(r < sizeof(uint32_t)) {
         /* Full header not read */
-        fprintf(stderr, "%s: short read (%d bytes)\n",
+        fprintf(stderr, "%s: short read (%ld bytes)\n",
                 __func__, r);
         exit(1);
     }
@@ -103,7 +103,7 @@
 
     if(r < rsize) {
         /* Full record not read */
-        fprintf(stderr, "%s: short read (%d, expected %d)\n",
+        fprintf(stderr, "%s: short read (%ld, expected %ld)\n",
                 __func__, r, rsize);
         return 0;
     }
@@ -145,7 +145,7 @@
 
     /* File sanity check */
     if(p->file_offset != p->next_cpu_change_offset) {
-        printf("Strange, pcpu %d expected offet %llx, actual %llx!\n",
+        printf("Strange, pcpu %d expected offet %lx, actual %lx!\n",
                 p->pid, p->next_cpu_change_offset, p->file_offset);
     }
 
@@ -158,7 +158,7 @@
     struct record_info *ri = &p->ri;
     int i;
     
-    printf("R p%2d o%016llx %8lx %d ",
+    printf("R p%2d o%016lx %8lx %d ",
            p->pid, p->file_offset,
            (unsigned long)ri->rec.event, ri->rec.extra_words);
 
xenalyze.c +23 -23

184 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

Hmm, that won't do; with this patch it won't compile on x86-32. :-)

I'll take a look and see what the best solution is. Thanks for the patch!

-George

Quoted 87 lines · Akio Takebe

Hi, George

It's interesting tool.
I got many error on x86_64 dom0 while compiling. The patch fixes these.

gcc -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes

(quoted diff) +0 -2
-Wno-unused-value -Wdeclaration-after-statement -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs -Werror -o xenalyze

xenalyze.c
cc1: warnings being treated as errors
xenalyze.c: In function 'init_hvm_data':
xenalyze.c:1321: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
xenalyze.c: In function 'hvm_msr_write_process':
xenalyze.c:4055: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'hvm_msr_read_process':
xenalyze.c:4104: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'shadow_emulate_process':
xenalyze.c:5128: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5142: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5156: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'shadow_parse_other':
xenalyze.c:5228: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5244: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5256: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'shadow_fixup_process':
xenalyze.c:5445: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5458: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5471: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'shadow_mmio_process':
xenalyze.c:5559: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c:5570: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'vcpu_create':
xenalyze.c:6080: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'domain_create':
xenalyze.c:6122: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
xenalyze.c: In function 'scan_for_new_pcpu':
xenalyze.c:7119: warning: format '%lld' expects type 'long long int', but argument 5 has type 'loff_t'
xenalyze.c: In function 'process_cpu_change':
xenalyze.c:7194: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'loff_t'
xenalyze.c:7194: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'loff_t'
xenalyze.c:7220: warning: format '%lld' expects type 'long long int', but argument 5 has type 'loff_t'
xenalyze.c:7245: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'loff_t'
xenalyze.c: In function '__read_record':
xenalyze.c:7538: warning: format '%d' expects type 'int', but argument 4 has type 'ssize_t'
xenalyze.c:7547: warning: format '%d' expects type 'int', but argument 4 has type 'ssize_t'
xenalyze.c:7547: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t'
xenalyze.c: In function '__fill_in_record_info':
xenalyze.c:7594: warning: format '%016llx' expects type 'long long unsigned int', but argument 3 has type 'loff_t'
make: *** [xenalyze] Error 1

Best Regards,

Akio Takebe

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 4 lines · George Dunlap

Hmm, that won't do; with this patch it won't compile on x86-32. :-)

I'll take a look and see what the best solution is. Thanks for the patch!

This should fix it properly. The key is to use the "z" format modifier meaning "size_t".

J

Fix 64-bit compilation

This fixes 64-bit compilation by using the 'z' printf format modifier to tell the compiler we're using size_t-typed arguments, and explicitly casting loff_t types to unsigned long long to match the format.

dump-raw.c +5 -4
diff -r 6466afa95122 -r 4efef3092ce7 dump-raw.c
@@ -94,7 +94,7 @@
         return 0;
     } else if(r < sizeof(uint32_t)) {
         /* Full header not read */
-        fprintf(stderr, "%s: short read (%d bytes)\n",
+        fprintf(stderr, "%s: short read (%zd bytes)\n",
                 __func__, r);
         exit(1);
     }
@@ -103,7 +103,7 @@
 
     if(r < rsize) {
         /* Full record not read */
-        fprintf(stderr, "%s: short read (%d, expected %d)\n",
+        fprintf(stderr, "%s: short read (%zd, expected %zd)\n",
                 __func__, r, rsize);
         return 0;
     }
@@ -146,7 +146,8 @@
     /* File sanity check */
     if(p->file_offset != p->next_cpu_change_offset) {
         printf("Strange, pcpu %d expected offet %llx, actual %llx!\n",
-                p->pid, p->next_cpu_change_offset, p->file_offset);
+	       p->pid, (unsigned long long)p->next_cpu_change_offset,
+	       (unsigned long long)p->file_offset);
     }
 
     p->next_cpu_change_offset = p->file_offset + ri->size + r->window_size;
@@ -159,7 +160,7 @@
     int i;
     
     printf("R p%2d o%016llx %8lx %d ",
-           p->pid, p->file_offset,
+           p->pid, (unsigned long long)p->file_offset,
            (unsigned long)ri->rec.event, ri->rec.extra_words);
 
     if(ri->rec.cycle_flag)
xenalyze.c +24 -23

185 lines not on this page · raw message