xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Anisov <andrii.anisov@gmail.com>
To: xen-devel@lists.xen.org
Cc: Wei Liu <wei.liu2@citrix.com>,
	Andrii Anisov <andrii_anisov@epam.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 3/5] xentrace_format: combine 64-bit LE values from traces
Date: Mon, 10 Sep 2018 19:41:17 +0300	[thread overview]
Message-ID: <1536597679-8303-4-git-send-email-andrii.anisov@gmail.com> (raw)
In-Reply-To: <1536597679-8303-1-git-send-email-andrii.anisov@gmail.com>

From: Andrii Anisov <andrii_anisov@epam.com>

In order to be able to print possible 64bit LE values from
trace records, precombine possible variants.

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
 tools/xentrace/xentrace_format | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/tools/xentrace/xentrace_format b/tools/xentrace/xentrace_format
index cae7d34..d989924 100644
--- a/tools/xentrace/xentrace_format
+++ b/tools/xentrace/xentrace_format
@@ -26,9 +26,11 @@ def usage():
             will output in hexadecimal and 'o' will output in octal ]
 
           Which correspond to the CPU number, event ID, timestamp counter and
-          the 7 data fields from the trace record.  There should be one such
-          rule for each type of event.
-          
+          the 7 data fields from the trace record. Also combined 64bit LE
+          fields are available. E.g. %(21)d is a decimal representation of a
+          64bit LE value placed as the first element of 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,
           this script may not be able to keep up with the output of xentrace
           if it is piped directly.  In these circumstances you should have
@@ -185,6 +187,13 @@ while not interrupted:
                 break
             (d1, d2, d3, d4, d5, d6, d7) = struct.unpack(D7REC, line)
 
+        d21 = (d2 << 32) | (0x00000000ffffffff & d1)
+        d32 = (d3 << 32) | (0x00000000ffffffff & d2)
+        d43 = (d4 << 32) | (0x00000000ffffffff & d3)
+        d54 = (d5 << 32) | (0x00000000ffffffff & d4)
+        d65 = (d6 << 32) | (0x00000000ffffffff & d5)
+        d76 = (d7 << 32) | (0x00000000ffffffff & d6)
+
         # Event field is 28bit of 'uint32_t' in header, not 'long'.
         event &= 0x0fffffff
         if event == 0x1f003:
@@ -239,7 +248,13 @@ while not interrupted:
                 '4'     : d4,
                 '5'     : d5,
                 '6'     : d6,
-                '7'     : d7    }
+                '7'     : d7,
+                '21'    : d21,
+                '32'    : d32,
+                '43'    : d43,
+                '54'    : d54,
+                '65'    : d65,
+                '76'    : d76    }
 
         try:
 
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-09-10 16:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10 16:41 [PATCH 0/5] Misc changes to xentrace_format Andrii Anisov
2018-09-10 16:41 ` [PATCH 1/5] xentrace_format: print timestamps in nanoseconds Andrii Anisov
2018-09-11 10:15   ` George Dunlap
2018-09-11 10:32     ` Andrii Anisov
2018-09-11 10:44       ` George Dunlap
2018-09-11 10:45         ` George Dunlap
2018-09-11 15:19         ` Andrii Anisov
2018-09-11 15:54           ` George Dunlap
2018-09-12  7:42             ` Dario Faggioli
2018-09-12 16:44               ` Andrii Anisov
2018-09-12 17:16             ` Andrii Anisov
2018-09-10 16:41 ` [PATCH 2/5] xentrace_format: switch mhz option to float Andrii Anisov
2018-09-11 10:21   ` George Dunlap
2018-09-10 16:41 ` Andrii Anisov [this message]
2018-09-11 10:48   ` [PATCH 3/5] xentrace_format: combine 64-bit LE values from traces George Dunlap
2018-09-11 12:23     ` Andrii Anisov
2018-09-12  7:47       ` Dario Faggioli
2018-09-10 16:41 ` [PATCH 4/5] formats: allign trace record format to the current code Andrii Anisov
2018-09-11 10:51   ` George Dunlap
2018-09-12  7:49   ` Dario Faggioli
2018-09-10 16:41 ` [PATCH 5/5] formats: print time values as decimals Andrii Anisov
2018-09-11 10:33   ` George Dunlap
2018-09-12  7:54     ` Dario Faggioli
2018-09-12 17:28       ` Andrii Anisov
2018-09-12 17:43         ` Dario Faggioli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536597679-8303-4-git-send-email-andrii.anisov@gmail.com \
    --to=andrii.anisov@gmail.com \
    --cc=andrii_anisov@epam.com \
    --cc=dfaggioli@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).