* [Qemu-devel] [PATCH] scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations.
@ 2011-11-09 6:25 Harsh Prateek Bora
2011-11-09 8:13 ` Aneesh Kumar K.V
0 siblings, 1 reply; 3+ messages in thread
From: Harsh Prateek Bora @ 2011-11-09 6:25 UTC (permalink / raw)
To: qemu-devel
Currently, we just print the numerical value of 9p operation identifier in
case of RERROR which is less meaningful for readability. Mapping 9p
operation ids to symbolic names provides a better tracelog:
RERROR (tag = 1 , id = TWALK , err = 2 )
RERROR (tag = 1 , id = TUNLINKAT , err = 39 )
This patch provides a dictionary of all possible 9p operation symbols mapped
to their numerical identifiers which are likely to be used in future at
various places in this script.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
---
scripts/analyse-9p-simpletrace.py | 72 ++++++++++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 1 deletions(-)
diff --git a/scripts/analyse-9p-simpletrace.py b/scripts/analyse-9p-simpletrace.py
index b6d58fd..ef463cb 100755
--- a/scripts/analyse-9p-simpletrace.py
+++ b/scripts/analyse-9p-simpletrace.py
@@ -5,13 +5,83 @@
# Author: Harsh Prateek Bora
import simpletrace
+symbol_9p = {
+ 6 : 'TLERROR',
+ 7 : 'RLERROR',
+ 8 : 'TSTATFS',
+ 9 : 'RSTATFS',
+ 12 : 'TLOPEN',
+ 13 : 'RLOPEN',
+ 14 : 'TLCREATE',
+ 15 : 'RLCREATE',
+ 16 : 'TSYMLINK',
+ 17 : 'RSYMLINK',
+ 18 : 'TMKNOD',
+ 19 : 'RMKNOD',
+ 20 : 'TRENAME',
+ 21 : 'RRENAME',
+ 22 : 'TREADLINK',
+ 23 : 'RREADLINK',
+ 24 : 'TGETATTR',
+ 25 : 'RGETATTR',
+ 26 : 'TSETATTR',
+ 27 : 'RSETATTR',
+ 30 : 'TXATTRWALK',
+ 31 : 'RXATTRWALK',
+ 32 : 'TXATTRCREATE',
+ 33 : 'RXATTRCREATE',
+ 40 : 'TREADDIR',
+ 41 : 'RREADDIR',
+ 50 : 'TFSYNC',
+ 51 : 'RFSYNC',
+ 52 : 'TLOCK',
+ 53 : 'RLOCK',
+ 54 : 'TGETLOCK',
+ 55 : 'RGETLOCK',
+ 70 : 'TLINK',
+ 71 : 'RLINK',
+ 72 : 'TMKDIR',
+ 73 : 'RMKDIR',
+ 74 : 'TRENAMEAT',
+ 75 : 'RRENAMEAT',
+ 76 : 'TUNLINKAT',
+ 77 : 'RUNLINKAT',
+ 100 : 'TVERSION',
+ 101 : 'RVERSION',
+ 102 : 'TAUTH',
+ 103 : 'RAUTH',
+ 104 : 'TATTACH',
+ 105 : 'RATTACH',
+ 106 : 'TERROR',
+ 107 : 'RERROR',
+ 108 : 'TFLUSH',
+ 109 : 'RFLUSH',
+ 110 : 'TWALK',
+ 111 : 'RWALK',
+ 112 : 'TOPEN',
+ 113 : 'ROPEN',
+ 114 : 'TCREATE',
+ 115 : 'RCREATE',
+ 116 : 'TREAD',
+ 117 : 'RREAD',
+ 118 : 'TWRITE',
+ 119 : 'RWRITE',
+ 120 : 'TCLUNK',
+ 121 : 'RCLUNK',
+ 122 : 'TREMOVE',
+ 123 : 'RREMOVE',
+ 124 : 'TSTAT',
+ 125 : 'RSTAT',
+ 126 : 'TWSTAT',
+ 127 : 'RWSTAT'
+}
class VirtFSRequestTracker(simpletrace.Analyzer):
def begin(self):
print "Pretty printing 9p simpletrace log ..."
def v9fs_rerror(self, tag, id, err):
- print "RERROR (tag =", tag, ", id =", id, ",err =", err, ")"
+ print "RERROR (tag =", tag, ", id =", symbol_9p[id], ", err =", err, ")"
def v9fs_version(self, tag, id, msize, version):
print "TVERSION (tag =", tag, ", msize =", msize, ", version =", version, ")"
--
1.7.1.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations.
2011-11-09 6:25 [Qemu-devel] [PATCH] scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations Harsh Prateek Bora
@ 2011-11-09 8:13 ` Aneesh Kumar K.V
2011-11-09 8:40 ` Harsh Bora
0 siblings, 1 reply; 3+ messages in thread
From: Aneesh Kumar K.V @ 2011-11-09 8:13 UTC (permalink / raw)
To: Harsh Prateek Bora, qemu-devel
On Wed, 9 Nov 2011 11:55:51 +0530, Harsh Prateek Bora <harsh@linux.vnet.ibm.com> wrote:
> Currently, we just print the numerical value of 9p operation identifier in
> case of RERROR which is less meaningful for readability. Mapping 9p
> operation ids to symbolic names provides a better tracelog:
>
> RERROR (tag = 1 , id = TWALK , err = 2 )
> RERROR (tag = 1 , id = TUNLINKAT , err = 39 )
It would be nice to map that err to a string. os.strerror(err) may be ?
>
> This patch provides a dictionary of all possible 9p operation symbols mapped
> to their numerical identifiers which are likely to be used in future at
> various places in this script.
>
> Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
> ---
-aneesh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations.
2011-11-09 8:13 ` Aneesh Kumar K.V
@ 2011-11-09 8:40 ` Harsh Bora
0 siblings, 0 replies; 3+ messages in thread
From: Harsh Bora @ 2011-11-09 8:40 UTC (permalink / raw)
To: qemu-devel, Aneesh Kumar K. V
On 11/09/2011 01:43 PM, Aneesh Kumar K.V wrote:
> On Wed, 9 Nov 2011 11:55:51 +0530, Harsh Prateek Bora<harsh@linux.vnet.ibm.com> wrote:
>> Currently, we just print the numerical value of 9p operation identifier in
>> case of RERROR which is less meaningful for readability. Mapping 9p
>> operation ids to symbolic names provides a better tracelog:
>>
>> RERROR (tag = 1 , id = TWALK , err = 2 )
>> RERROR (tag = 1 , id = TUNLINKAT , err = 39 )
>
> It would be nice to map that err to a string. os.strerror(err) may be ?
>
makes sense, however os.strerror prints multi word text explaining the
error and not just the symbolic word, hope its okay:
RERROR (tag = 1 , id = TWALK , err = No such file or directory )
RERROR (tag = 1 , id = TUNLINKAT , err = Directory not empty )
will update in v2.
>
>>
>> This patch provides a dictionary of all possible 9p operation symbols mapped
>> to their numerical identifiers which are likely to be used in future at
>> various places in this script.
>>
>> Signed-off-by: Harsh Prateek Bora<harsh@linux.vnet.ibm.com>
>> ---
>
> -aneesh
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-09 8:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-09 6:25 [Qemu-devel] [PATCH] scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations Harsh Prateek Bora
2011-11-09 8:13 ` Aneesh Kumar K.V
2011-11-09 8:40 ` Harsh Bora
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).