2 * Copyright (C) 2016 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * Format of the parsed workload files.
20 * 2) Table of the entries, each entry describes 1 file
21 * 3) Table of IO operations to perform on the files
25 * The parsed workload file starts off with the header, which
26 * contains the count of the total # of files that are operated on.
27 * and the total number of IO operations.
29 struct ioshark_header {
31 int num_io_operations;
35 * After the header, we have a table of #files entries. Each entry
36 * in this table describes 1 file, indexed by fileno and with the
38 * Before the tests starts, these files are pre-created.
40 struct ioshark_file_state {
41 int fileno; /* 1..num_files, with files name ioshark.<fileno> */
43 int global_filename_ix;
60 IOSHARK_MAPPED_PWRITE,
65 #define IOSHARK_PROT_READ 0x1
66 #define IOSHARK_PROT_WRITE 0x2
69 * Next we have the table of IO operatiosn to perform. Each
70 * IO operation is described by this entry.
72 struct ioshark_file_operation {
73 /* delta us between previous file op and this */
79 #define lseek_offset u.lseek_a.offset
80 #define lseek_action u.lseek_a.action
85 #define prw_offset u.prw_a.offset
86 #define prw_len u.prw_a.len
90 #define rw_len u.rw_a.len
94 #define mmap_offset u.mmap_a.offset
95 #define mmap_len u.mmap_a.len
96 #define mmap_prot u.mmap_a.prot
102 #define open_flags u.open_a.flags
103 #define open_mode u.open_a.mode
111 #define MAX_IOSHARK_PATHLEN 512
114 * Global table of all fileames
116 struct ioshark_filename_struct
118 char path[MAX_IOSHARK_PATHLEN];