qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations.

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 = " No such file or directory ")
RERROR (tag = 1 , id = TUNLINKAT , err = " Directory not empty ")

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>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

authored by

Harsh Prateek Bora and committed by
Aneesh Kumar K.V
058a96ed e4027caf

+73 -2
+73 -2
scripts/analyse-9p-simpletrace.py
··· 3 3 # Usage: ./analyse-9p-simpletrace <trace-events> <trace-pid> 4 4 # 5 5 # Author: Harsh Prateek Bora 6 + import os 7 + import simpletrace 6 8 7 - import simpletrace 9 + symbol_9p = { 10 + 6 : 'TLERROR', 11 + 7 : 'RLERROR', 12 + 8 : 'TSTATFS', 13 + 9 : 'RSTATFS', 14 + 12 : 'TLOPEN', 15 + 13 : 'RLOPEN', 16 + 14 : 'TLCREATE', 17 + 15 : 'RLCREATE', 18 + 16 : 'TSYMLINK', 19 + 17 : 'RSYMLINK', 20 + 18 : 'TMKNOD', 21 + 19 : 'RMKNOD', 22 + 20 : 'TRENAME', 23 + 21 : 'RRENAME', 24 + 22 : 'TREADLINK', 25 + 23 : 'RREADLINK', 26 + 24 : 'TGETATTR', 27 + 25 : 'RGETATTR', 28 + 26 : 'TSETATTR', 29 + 27 : 'RSETATTR', 30 + 30 : 'TXATTRWALK', 31 + 31 : 'RXATTRWALK', 32 + 32 : 'TXATTRCREATE', 33 + 33 : 'RXATTRCREATE', 34 + 40 : 'TREADDIR', 35 + 41 : 'RREADDIR', 36 + 50 : 'TFSYNC', 37 + 51 : 'RFSYNC', 38 + 52 : 'TLOCK', 39 + 53 : 'RLOCK', 40 + 54 : 'TGETLOCK', 41 + 55 : 'RGETLOCK', 42 + 70 : 'TLINK', 43 + 71 : 'RLINK', 44 + 72 : 'TMKDIR', 45 + 73 : 'RMKDIR', 46 + 74 : 'TRENAMEAT', 47 + 75 : 'RRENAMEAT', 48 + 76 : 'TUNLINKAT', 49 + 77 : 'RUNLINKAT', 50 + 100 : 'TVERSION', 51 + 101 : 'RVERSION', 52 + 102 : 'TAUTH', 53 + 103 : 'RAUTH', 54 + 104 : 'TATTACH', 55 + 105 : 'RATTACH', 56 + 106 : 'TERROR', 57 + 107 : 'RERROR', 58 + 108 : 'TFLUSH', 59 + 109 : 'RFLUSH', 60 + 110 : 'TWALK', 61 + 111 : 'RWALK', 62 + 112 : 'TOPEN', 63 + 113 : 'ROPEN', 64 + 114 : 'TCREATE', 65 + 115 : 'RCREATE', 66 + 116 : 'TREAD', 67 + 117 : 'RREAD', 68 + 118 : 'TWRITE', 69 + 119 : 'RWRITE', 70 + 120 : 'TCLUNK', 71 + 121 : 'RCLUNK', 72 + 122 : 'TREMOVE', 73 + 123 : 'RREMOVE', 74 + 124 : 'TSTAT', 75 + 125 : 'RSTAT', 76 + 126 : 'TWSTAT', 77 + 127 : 'RWSTAT' 78 + } 8 79 9 80 class VirtFSRequestTracker(simpletrace.Analyzer): 10 81 def begin(self): 11 82 print "Pretty printing 9p simpletrace log ..." 12 83 13 84 def v9fs_rerror(self, tag, id, err): 14 - print "RERROR (tag =", tag, ", id =", id, ",err =", err, ")" 85 + print "RERROR (tag =", tag, ", id =", symbol_9p[id], ", err = \"", os.strerror(err), "\")" 15 86 16 87 def v9fs_version(self, tag, id, msize, version): 17 88 print "TVERSION (tag =", tag, ", msize =", msize, ", version =", version, ")"