diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-06-09 09:45:38 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-06-09 09:45:38 +0100 |
commit | 591e88391250ccb38b3726f8ea6cdc89587e6d71 (patch) | |
tree | 5ce52412e627c4a9955b4c20288f37b1a0995125 /tools/xentrace/xentrace_format | |
parent | 00093d732e00b6486650c7ad8c0ef4c01d31aa30 (diff) | |
download | xen-591e88391250ccb38b3726f8ea6cdc89587e6d71.tar.gz xen-591e88391250ccb38b3726f8ea6cdc89587e6d71.tar.bz2 xen-591e88391250ccb38b3726f8ea6cdc89587e6d71.zip |
xentrace: fix tracing for 64bit guests
Xen tracing some times ago used to put values of type 'long' into the
trace buffer. This has changed to uint32_t. Some trace points log
virtual addresses, which get cropped to 32bit in this case. There were
some inline functions to handle at least PF_XEN and VMEXIT, which
caused a lot of code duplication. The attached patch fixes several
issues:
1. fix and extend tools/xentrace/formats
2. Fix xentrace_format to handle up to 7 parameters
3. create convenience macros to properly log long values
4. remove the inline functions in hvm/trace.h and replace them by macros
5. Change the CPUID trace to work correctly
6. group HVM trace points enable mechanism
I used a similar approach as in PV tracing with bit 8 indicating 64bit
pointers.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Diffstat (limited to 'tools/xentrace/xentrace_format')
-rw-r--r-- | tools/xentrace/xentrace_format | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tools/xentrace/xentrace_format b/tools/xentrace/xentrace_format index 6399217bb6..d66cb74578 100644 --- a/tools/xentrace/xentrace_format +++ b/tools/xentrace/xentrace_format @@ -17,12 +17,12 @@ def usage(): {event_id}{whitespace}{text format string} The textual format string may include format specifiers, such as: - %(cpu)d, %(tsc)d, %(event)d, %(1)d, %(2)d, %(3)d, %(4)d, %(5)d + %(cpu)d, %(tsc)d, %(event)d, %(1)d, %(2)d, %(3)d, %(4)d, ... [ the 'd' format specifier outputs in decimal, alternatively 'x' will output in hexadecimal and 'o' will output in octal ] Which correspond to the CPU number, event ID, timestamp counter and - the 5 data fields from the trace record. There should be one such + the 7 data fields from the trace record. There should be one such rule for each type of event. Depending on your system and the volume of trace buffer data, @@ -84,7 +84,7 @@ interrupted = 0 defs = read_defs(arg[0]) # structure of trace record (as output by xentrace): -# HDR(I) {TSC(Q)} D1(I) D2(I) D3(I) D4(I) D5(I) +# HDR(I) {TSC(Q)} D1(I) D2(I) D3(I) D4(I) D5(I) D6(I) D7(I) # # HDR consists of EVENT:28:, n_data:3:, tsc_in:1: # EVENT means Event ID @@ -101,6 +101,8 @@ D2REC = "II" D3REC = "III" D4REC = "IIII" D5REC = "IIIII" +D6REC = "IIIIII" +D7REC = "IIIIIII" last_tsc = [0] @@ -121,6 +123,8 @@ while not interrupted: d3 = 0 d4 = 0 d5 = 0 + d6 = 0 + d7 = 0 tsc = 0 @@ -155,6 +159,16 @@ while not interrupted: if not line: break (d1, d2, d3, d4, d5) = struct.unpack(D5REC, line) + if n_data == 6: + line = sys.stdin.read(struct.calcsize(D6REC)) + if not line: + break + (d1, d2, d3, d4, d5, d6) = struct.unpack(D6REC, line) + if n_data == 7: + line = sys.stdin.read(struct.calcsize(D7REC)) + if not line: + break + (d1, d2, d3, d4, d5, d6, d7) = struct.unpack(D7REC, line) # Event field is 28bit of 'uint32_t' in header, not 'long'. event &= 0x0fffffff @@ -191,7 +205,9 @@ while not interrupted: '2' : d2, '3' : d3, '4' : d4, - '5' : d5 } + '5' : d5, + '6' : d6, + '7' : d7 } try: |