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