liyujie
2025-08-28 b3810562527858a3b3d98ffa6e9c9c5b0f4a9a8e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
IOshark is a repeatable application workload storage benchmark. You
can find more documentation on IOshark at :
https://docs.google.com/a/google.com/document/d/1Bhq7iNPVc_JzwRrkmZqcPjMvWgpHX0r3Ncq-ZsRNOBA/edit?usp=sharing
 
The short summary of what IOshark is : IOshark has 2 components, one
is a strace+ftrace compiler that takes straces and select ftraces fed
into it and compiles this into bytecodes (stored in *.wl files). The
compiler runs on a Linux host. The second component (which runs on the
device) is the tester that takes as input the bytecode files (*.wl
files) and executes them on the device.
 
How to Run :
----------
- First collect straces and compile these into bytecodes. The wrapper
script provided (collect-straces.sh) collects straces, ships them to
the host where the script runs, compiles and packages up the bytecode
files into a wl.tar file.
- Ship the wl.tar file and the iostark_bench binaries to the target
device (on /data/local/tmp say). Explode the tarfile.
- Run the tester. "ioshark_bench *.wl" runs the test with default
options. Supported ioshark_bench options :
-b : Explicitly specify a blockdev (to get IO stats from from
/proc/diskstats).
-d : Preserve the delays between successive filesystem syscalls as
seen in the original straces.
-n <N> : Run for N iterations
-t <N> : Limit to N threads. By default (without this option), IOshark
will launch as many threads as there are input files, so 1 thread/file.
-v : verbose. Chatty mode.
-s : One line summary.
-q : Don't create the files in read-only partitions like /system and
/vendor. Instead do reads on those files.
 
FILE FORMAT :
-----------
 
Each IOshark workload file is composed of the following
 
Header
File State : Table of File Entries. Each entry describes a file
File Op : Table of File Operations. One entry describes one operation
 
Each of the above is described below :
 
Note : Everything is in Big Endian byte order.
 
Header {
       /* IOshark version number */
       u_int64_t    ioshark_version;
       /* Total number of files used in this IOshark workload file */
       u_int64_t    num_files;
       /* Total number of IO operations in this IOshark workload file */
       u_int64_t       num_io_operations;
}
 
File State {
       u_int64_t    fileno;
       u_int64_t    size;
       u_int64_t     global_filename_ix;
}
 
File Op {
   /* delta us between previous file op and this */
   u_int64_t        delta_us;
#define file_op            file_op_union.file_op_u
   union {
       enum file_op        file_op_u;
       int32_t            enum_size;
   } file_op_union;
   u_int64_t        fileno;
   union {
       struct lseek_args {
#define lseek_offset    u.lseek_a.offset
#define lseek_action    u.lseek_a.action
           u_int64_t    offset;
           int32_t        action;
       } lseek_a;
       struct prw_args {
#define prw_offset    u.prw_a.offset
#define prw_len        u.prw_a.len
           u_int64_t    offset;
           u_int64_t    len;
       } prw_a;
#define rw_len        u.rw_a.len
       struct rw_args {
           u_int64_t    len;
       } rw_a;
#define mmap_offset    u.mmap_a.offset
#define mmap_len    u.mmap_a.len
#define mmap_prot    u.mmap_a.prot
       struct mmap_args {
           u_int64_t    offset;
           u_int64_t    len;
           int32_t        prot;
   } mmap_a;
#define open_flags    u.open_a.flags
#define open_mode    u.open_a.mode
       struct open_args {
           int32_t        flags;
           int32_t        mode;
       } open_a;
   } u;
 
}