1syntax = "proto2"; 2 3package dittosuiteproto; 4 5enum Order { 6 SEQUENTIAL = 0; 7 RANDOM = 1; 8} 9 10enum Reseeding { 11 ONCE = 0; 12 EACH_ROUND_OF_CYCLES = 1; 13 EACH_CYCLE = 2; 14} 15 16enum AccessMode { 17 READ_ONLY = 1; 18 WRITE_ONLY = 2; 19 READ_WRITE = 3; 20} 21 22enum FreePolicy { 23 FREE_POLICY_UNSPECIFIED = 0; 24 FREE_POLICY_EVERY_PERIOD = 1; 25 FREE_POLICY_LAST_PERIOD = 2; 26 FREE_POLICY_KEEP = 3; 27} 28 29message MemoryAllocate { 30 optional uint64 size = 1; 31 optional FreePolicy free_policy = 2 [default = FREE_POLICY_KEEP]; 32} 33 34message CpuWork { 35 oneof type { 36 uint64 cycles = 1; 37 double utilization = 2; 38 } 39} 40 41message BinderService { 42 optional string name = 1; 43 optional uint32 threads = 2; 44} 45 46message BinderRequest { 47 enum RunningService { 48 MOUNT_SERVICE = 0; 49 }; 50 message GenericService { 51 message ParcelInput { 52 message NestedParcel { 53 repeated ParcelInput parcel_inputs = 1; 54 } 55 enum Type { 56 // Write the 32-bit integer into the send parcel. 57 I32 = 0; 58 // Write the 64-bit integer into the send parcel. 59 I64 = 1; 60 // Write the UTF-16 string STR into the send parcel. 61 STRING_16 = 2; 62 // Write the 32-bit single-precision number into the send parcel. 63 F = 3; 64 // Write the 64-bit double-precision number into the send parcel. 65 D = 4; 66 // Write a null binder into the send parcel. 67 NULL = 5; 68 // Data: File name 69 // Write a file descriptor for the file with given path into the send 70 // parcel. 71 FD_PATH = 6; 72 // Data: File name 73 // Write an ashmem file descriptor for a region containing the data 74 // from file the given path into the send parcel. 75 ASHMEM_FD_PATH = 7; 76 // Data: FD number 77 // Write the file descriptor into the send parcel. 78 FD = 8; 79 // Parcel input that is nested inside. 80 PARCEL = 9; 81 } 82 optional Type type = 1; 83 oneof data_oneof { 84 string data = 2; 85 NestedParcel nested_parcel = 3; 86 } 87 } 88 optional string name = 1; 89 optional int32 code = 2; 90 repeated ParcelInput parcel_input = 3; 91 } 92 oneof service_oneof { 93 string service_name = 1; 94 RunningService running_service = 2; 95 GenericService generic_service = 3; 96 } 97} 98 99message OpenFile { 100 oneof file { 101 string path_name = 1; 102 string input = 2; 103 } 104 optional string output_fd = 3; 105 optional bool create = 4 [default = true]; 106 optional bool direct_io = 5 [default = false]; 107 optional AccessMode access_mode = 6 [default = READ_WRITE]; 108} 109 110message DeleteFile { 111 oneof file { 112 string path_name = 1; 113 string input = 2; 114 } 115} 116 117message CloseFile { 118 required string input_fd = 1; 119} 120 121message ResizeFile { 122 required string input_fd = 1; 123 required int64 size = 2; 124} 125 126message ResizeFileRandom { 127 required string input_fd = 1; 128 required int64 min = 2; 129 required int64 max = 3; 130 optional uint32 seed = 4; 131 optional Reseeding reseeding = 5 [default = ONCE]; 132} 133 134message WriteFile { 135 required string input_fd = 1; 136 optional int64 size = 2 [default = -1]; 137 optional int64 block_size = 3 [default = 4096]; 138 optional int64 starting_offset = 4 [default = 0]; 139 optional Order access_order = 5 [default = SEQUENTIAL]; 140 optional uint32 seed = 6; 141 optional bool fsync = 7 [default = false]; 142 optional Reseeding reseeding = 8 [default = ONCE]; 143} 144 145message ReadFile { 146 enum ReadFAdvise { 147 AUTOMATIC = 0; 148 NORMAL = 1; 149 SEQUENTIAL = 2; 150 RANDOM = 3; 151 } 152 required string input_fd = 1; 153 optional int64 size = 2 [default = -1]; 154 optional int64 block_size = 3 [default = 4096]; 155 optional int64 starting_offset = 4 [default = 0]; 156 optional Order access_order = 5 [default = SEQUENTIAL]; 157 optional uint32 seed = 6; 158 optional ReadFAdvise fadvise = 7 [default = AUTOMATIC]; 159 optional Reseeding reseeding = 8 [default = ONCE]; 160} 161 162message ReadDirectory { 163 required string directory_name = 1; 164 required string output = 2; 165} 166 167message Thread { 168 required Instruction instruction = 1; 169 optional int32 spawn = 2 [default = 1]; 170 optional string name = 3; 171 optional SchedAttr sched_attr = 4; 172 optional int64 sched_affinity = 5 [default = -1]; 173} 174 175message SchedAttr { 176 message SchedOther { 177 enum SchedPolicy { 178 OTHER = 1; 179 BATCH = 2; 180 } 181 required SchedPolicy policy = 1; 182 optional int32 nice = 2 [default = 10]; 183 } 184 message SchedRt { 185 enum SchedPolicy { 186 FIFO = 1; 187 RR = 2; 188 } 189 required SchedPolicy policy = 1; 190 required uint32 priority = 2; 191 } 192 message SchedDeadline { 193 enum SchedPolicy { 194 DEADLINE = 1; 195 } 196 required SchedPolicy policy = 1; 197 required uint64 runtime = 2; 198 required uint64 deadline = 3; 199 required uint64 period = 4; 200 } 201 202 optional uint64 flags = 1 [default = 0]; 203 oneof attributes { 204 SchedOther other = 2; 205 SchedRt rt = 3; 206 SchedDeadline deadline = 4; 207 } 208} 209 210message Multithreading { 211 repeated Thread threads = 1; 212 optional bool fork = 2 [default = false]; 213} 214 215message InvalidateCache {} 216 217message Instruction { 218 optional int32 repeat = 1 [default = 1]; 219 oneof instruction_oneof { 220 InstructionSet instruction_set = 2; 221 OpenFile open_file = 3; 222 DeleteFile delete_file = 4; 223 CloseFile close_file = 5; 224 ResizeFile resize_file = 6; 225 WriteFile write_file = 7; 226 ReadFile read_file = 8; 227 ReadDirectory read_directory = 9; 228 ResizeFileRandom resize_file_random = 10; 229 Multithreading multithreading = 11; 230 InvalidateCache invalidate_cache = 12; 231 BinderRequest binder_request = 13; 232 BinderService binder_service = 14; 233 CpuWork cpu_work = 16; 234 MemoryAllocate mem_alloc = 17; 235 }; 236 optional uint64 period_us = 15 [default = 0]; 237 optional uint64 offset_us = 18 [default = 0]; 238} 239 240message InstructionSet { 241 repeated Instruction instructions = 1; 242 optional InstructionSetIterate iterate_options = 2; 243} 244 245message InstructionSetIterate { 246 required string list_name = 1; 247 required string item_name = 2; 248 optional Order access_order = 3 [default = SEQUENTIAL]; 249 optional Reseeding reseeding = 4 [default = ONCE]; 250 optional uint32 seed = 5; 251} 252 253message Global { 254 optional string absolute_path = 1 [default = ""]; 255} 256 257message Benchmark { 258 optional Instruction init = 1; 259 required Instruction main = 2; 260 optional Instruction clean_up = 3; 261 required Global global = 4; 262} 263