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