Commit | Line | Data |
---|---|---|
51167799 JA |
1 | #include <string.h> |
2 | ||
2dc1cbb5 JA |
3 | #include "thread_options.h" |
4 | ||
5 | static void string_to_cpu(char **dst, const uint8_t *src) | |
6 | { | |
7 | const char *__src = (const char *) src; | |
8 | ||
9 | if (strlen(__src)) | |
10 | *dst = strdup(__src); | |
11 | } | |
12 | ||
13 | static void string_to_net(uint8_t *dst, const char *src) | |
14 | { | |
15 | if (src) | |
16 | strcpy((char *) dst, src); | |
17 | else | |
18 | dst[0] = '\0'; | |
19 | } | |
20 | ||
21 | void convert_thread_options_to_cpu(struct thread_options *o, | |
22 | struct thread_options_pack *top) | |
23 | { | |
24 | int i, j; | |
25 | ||
26 | string_to_cpu(&o->description, top->description); | |
27 | string_to_cpu(&o->name, top->name); | |
28 | string_to_cpu(&o->directory, top->directory); | |
29 | string_to_cpu(&o->filename, top->filename); | |
30 | string_to_cpu(&o->opendir, top->opendir); | |
31 | string_to_cpu(&o->ioengine, top->ioengine); | |
32 | string_to_cpu(&o->read_iolog_file, top->read_iolog_file); | |
33 | string_to_cpu(&o->write_iolog_file, top->write_iolog_file); | |
34 | string_to_cpu(&o->bw_log_file, top->bw_log_file); | |
35 | string_to_cpu(&o->lat_log_file, top->lat_log_file); | |
36 | string_to_cpu(&o->iops_log_file, top->iops_log_file); | |
37 | string_to_cpu(&o->replay_redirect, top->replay_redirect); | |
38 | string_to_cpu(&o->exec_prerun, top->exec_prerun); | |
39 | string_to_cpu(&o->exec_postrun, top->exec_postrun); | |
40 | string_to_cpu(&o->ioscheduler, top->ioscheduler); | |
41 | string_to_cpu(&o->profile, top->profile); | |
42 | string_to_cpu(&o->cgroup, top->cgroup); | |
43 | ||
44 | o->td_ddir = le32_to_cpu(top->td_ddir); | |
45 | o->rw_seq = le32_to_cpu(top->rw_seq); | |
46 | o->kb_base = le32_to_cpu(top->kb_base); | |
47 | o->ddir_seq_nr = le32_to_cpu(top->ddir_seq_nr); | |
48 | o->ddir_seq_add = le64_to_cpu(top->ddir_seq_add); | |
49 | o->iodepth = le32_to_cpu(top->iodepth); | |
50 | o->iodepth_low = le32_to_cpu(top->iodepth_low); | |
51 | o->iodepth_batch = le32_to_cpu(top->iodepth_batch); | |
52 | o->iodepth_batch_complete = le32_to_cpu(top->iodepth_batch_complete); | |
53 | o->size = le64_to_cpu(top->size); | |
54 | o->size_percent = le32_to_cpu(top->size_percent); | |
55 | o->fill_device = le32_to_cpu(top->fill_device); | |
56 | o->file_size_low = le64_to_cpu(top->file_size_low); | |
57 | o->file_size_high = le64_to_cpu(top->file_size_high); | |
58 | o->start_offset = le64_to_cpu(top->start_offset); | |
59 | ||
60 | for (i = 0; i < 2; i++) { | |
61 | o->bs[i] = le32_to_cpu(top->bs[i]); | |
62 | o->ba[i] = le32_to_cpu(top->ba[i]); | |
63 | o->min_bs[i] = le32_to_cpu(top->min_bs[i]); | |
64 | o->max_bs[i] = le32_to_cpu(top->max_bs[i]); | |
65 | o->bssplit_nr[i] = le32_to_cpu(top->bssplit_nr[i]); | |
66 | ||
67 | if (o->bssplit_nr[i]) { | |
68 | o->bssplit[i] = malloc(o->bssplit_nr[i] * sizeof(struct bssplit)); | |
69 | for (j = 0; j < o->bssplit_nr[i]; j++) { | |
70 | o->bssplit[i][j].bs = le32_to_cpu(top->bssplit[i][j].bs); | |
71 | o->bssplit[i][j].perc = le32_to_cpu(top->bssplit[i][j].perc); | |
72 | } | |
73 | } | |
74 | ||
75 | o->rwmix[i] = le32_to_cpu(top->rwmix[i]); | |
76 | o->rate[i] = le32_to_cpu(top->rate[i]); | |
77 | o->ratemin[i] = le32_to_cpu(top->ratemin[i]); | |
78 | o->rate_iops[i] = le32_to_cpu(top->rate_iops[i]); | |
79 | o->rate_iops_min[i] = le32_to_cpu(top->rate_iops_min[i]); | |
80 | } | |
81 | ||
82 | o->ratecycle = le32_to_cpu(top->ratecycle); | |
83 | o->nr_files = le32_to_cpu(top->nr_files); | |
84 | o->open_files = le32_to_cpu(top->open_files); | |
85 | o->file_lock_mode = le32_to_cpu(top->file_lock_mode); | |
86 | o->lockfile_batch = le32_to_cpu(top->lockfile_batch); | |
87 | o->odirect = le32_to_cpu(top->odirect); | |
88 | o->invalidate_cache = le32_to_cpu(top->invalidate_cache); | |
89 | o->create_serialize = le32_to_cpu(top->create_serialize); | |
90 | o->create_fsync = le32_to_cpu(top->create_fsync); | |
91 | o->create_on_open = le32_to_cpu(top->create_on_open); | |
92 | o->end_fsync = le32_to_cpu(top->end_fsync); | |
93 | o->pre_read = le32_to_cpu(top->pre_read); | |
94 | o->sync_io = le32_to_cpu(top->sync_io); | |
95 | o->verify = le32_to_cpu(top->verify); | |
96 | o->do_verify = le32_to_cpu(top->do_verify); | |
97 | o->verifysort = le32_to_cpu(top->verifysort); | |
98 | o->verify_interval = le32_to_cpu(top->verify_interval); | |
99 | o->verify_offset = le32_to_cpu(top->verify_offset); | |
100 | ||
101 | memcpy(o->verify_pattern, top->verify_pattern, MAX_PATTERN_SIZE); | |
102 | ||
103 | o->verify_pattern_bytes = le32_to_cpu(top->verify_pattern_bytes); | |
104 | o->verify_fatal = le32_to_cpu(top->verify_fatal); | |
105 | o->verify_dump = le32_to_cpu(top->verify_dump); | |
106 | o->verify_async = le32_to_cpu(top->verify_async); | |
107 | o->verify_batch = le32_to_cpu(top->verify_batch); | |
108 | o->use_thread = le32_to_cpu(top->use_thread); | |
109 | o->unlink = le32_to_cpu(top->unlink); | |
110 | o->do_disk_util = le32_to_cpu(top->do_disk_util); | |
111 | o->override_sync = le32_to_cpu(top->override_sync); | |
112 | o->rand_repeatable = le32_to_cpu(top->rand_repeatable); | |
113 | o->use_os_rand = le32_to_cpu(top->use_os_rand); | |
114 | o->write_lat_log = le32_to_cpu(top->write_lat_log); | |
115 | o->write_bw_log = le32_to_cpu(top->write_bw_log); | |
116 | o->write_iops_log = le32_to_cpu(top->write_iops_log); | |
117 | o->log_avg_msec = le32_to_cpu(top->log_avg_msec); | |
118 | o->norandommap = le32_to_cpu(top->norandommap); | |
119 | o->softrandommap = le32_to_cpu(top->softrandommap); | |
120 | o->bs_unaligned = le32_to_cpu(top->bs_unaligned); | |
121 | o->fsync_on_close = le32_to_cpu(top->fsync_on_close); | |
122 | o->hugepage_size = le32_to_cpu(top->hugepage_size); | |
123 | o->rw_min_bs = le32_to_cpu(top->rw_min_bs); | |
124 | o->thinktime = le32_to_cpu(top->thinktime); | |
125 | o->thinktime_spin = le32_to_cpu(top->thinktime_spin); | |
126 | o->thinktime_blocks = le32_to_cpu(top->thinktime_blocks); | |
127 | o->fsync_blocks = le32_to_cpu(top->fsync_blocks); | |
128 | o->fdatasync_blocks = le32_to_cpu(top->fdatasync_blocks); | |
129 | o->barrier_blocks = le32_to_cpu(top->barrier_blocks); | |
130 | ||
131 | o->verify_backlog = le64_to_cpu(top->verify_backlog); | |
132 | o->start_delay = le64_to_cpu(top->start_delay); | |
133 | o->timeout = le64_to_cpu(top->timeout); | |
134 | o->ramp_time = le64_to_cpu(top->ramp_time); | |
135 | o->zone_range = le64_to_cpu(top->zone_range); | |
136 | o->zone_size = le64_to_cpu(top->zone_size); | |
137 | o->zone_skip = le64_to_cpu(top->zone_skip); | |
138 | ||
139 | o->overwrite = le32_to_cpu(top->overwrite); | |
140 | o->bw_avg_time = le32_to_cpu(top->bw_avg_time); | |
141 | o->iops_avg_time = le32_to_cpu(top->iops_avg_time); | |
142 | o->loops = le32_to_cpu(top->loops); | |
143 | o->mem_type = le32_to_cpu(top->mem_type); | |
144 | o->mem_align = le32_to_cpu(top->mem_align); | |
145 | o->stonewall = le32_to_cpu(top->stonewall); | |
146 | o->new_group = le32_to_cpu(top->new_group); | |
147 | o->numjobs = le32_to_cpu(top->numjobs); | |
148 | o->cpumask_set = le32_to_cpu(top->cpumask_set); | |
149 | o->verify_cpumask_set = le32_to_cpu(top->verify_cpumask_set); | |
150 | o->iolog = le32_to_cpu(top->iolog); | |
151 | o->rwmixcycle = le32_to_cpu(top->rwmixcycle); | |
152 | o->nice = le32_to_cpu(top->nice); | |
153 | o->file_service_type = le32_to_cpu(top->file_service_type); | |
154 | o->group_reporting = le32_to_cpu(top->group_reporting); | |
155 | o->fadvise_hint = le32_to_cpu(top->fadvise_hint); | |
156 | o->fallocate_mode = le32_to_cpu(top->fallocate_mode); | |
157 | o->zero_buffers = le32_to_cpu(top->zero_buffers); | |
158 | o->refill_buffers = le32_to_cpu(top->refill_buffers); | |
159 | o->scramble_buffers = le32_to_cpu(top->scramble_buffers); | |
160 | o->time_based = le32_to_cpu(top->time_based); | |
161 | o->disable_lat = le32_to_cpu(top->disable_lat); | |
162 | o->disable_clat = le32_to_cpu(top->disable_clat); | |
163 | o->disable_slat = le32_to_cpu(top->disable_slat); | |
164 | o->disable_bw = le32_to_cpu(top->disable_bw); | |
165 | o->gtod_reduce = le32_to_cpu(top->gtod_reduce); | |
166 | o->gtod_cpu = le32_to_cpu(top->gtod_cpu); | |
167 | o->gtod_offload = le32_to_cpu(top->gtod_offload); | |
168 | o->clocksource = le32_to_cpu(top->clocksource); | |
169 | o->no_stall = le32_to_cpu(top->no_stall); | |
170 | o->trim_percentage = le32_to_cpu(top->trim_percentage); | |
171 | o->trim_batch = le32_to_cpu(top->trim_batch); | |
172 | o->trim_zero = le32_to_cpu(top->trim_zero); | |
173 | o->clat_percentiles = le32_to_cpu(top->clat_percentiles); | |
174 | o->overwrite_plist = le32_to_cpu(top->overwrite_plist); | |
175 | o->cpuload = le32_to_cpu(top->cpuload); | |
176 | o->cpucycle = le32_to_cpu(top->cpucycle); | |
177 | o->continue_on_error = le32_to_cpu(top->continue_on_error); | |
178 | o->cgroup_weight = le32_to_cpu(top->cgroup_weight); | |
179 | o->cgroup_nodelete = le32_to_cpu(top->cgroup_nodelete); | |
180 | o->uid = le32_to_cpu(top->uid); | |
181 | o->gid = le32_to_cpu(top->gid); | |
182 | o->flow_id = __le32_to_cpu(top->flow_id); | |
183 | o->flow = __le32_to_cpu(top->flow); | |
184 | o->flow_watermark = __le32_to_cpu(top->flow_watermark); | |
185 | o->flow_sleep = le32_to_cpu(top->flow_sleep); | |
186 | o->sync_file_range = le32_to_cpu(top->sync_file_range); | |
187 | ||
188 | o->trim_backlog = le64_to_cpu(top->trim_backlog); | |
189 | ||
190 | for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++) | |
191 | o->percentile_list[i].u.f = fio_uint64_to_double(le64_to_cpu(top->percentile_list[i].u.i)); | |
192 | #if 0 | |
193 | uint8_t cpumask[FIO_TOP_STR_MAX]; | |
194 | uint8_t verify_cpumask[FIO_TOP_STR_MAX]; | |
195 | #endif | |
196 | } | |
197 | ||
198 | void convert_thread_options_to_net(struct thread_options_pack *top, | |
199 | struct thread_options *o) | |
200 | { | |
201 | int i, j; | |
202 | ||
203 | string_to_net(top->description, o->description); | |
204 | string_to_net(top->name, o->name); | |
205 | string_to_net(top->directory, o->directory); | |
206 | string_to_net(top->filename, o->filename); | |
207 | string_to_net(top->opendir, o->opendir); | |
208 | string_to_net(top->ioengine, o->ioengine); | |
209 | string_to_net(top->read_iolog_file, o->read_iolog_file); | |
210 | string_to_net(top->write_iolog_file, o->write_iolog_file); | |
211 | string_to_net(top->bw_log_file, o->bw_log_file); | |
212 | string_to_net(top->lat_log_file, o->lat_log_file); | |
213 | string_to_net(top->iops_log_file, o->iops_log_file); | |
214 | string_to_net(top->replay_redirect, o->replay_redirect); | |
215 | string_to_net(top->exec_prerun, o->exec_prerun); | |
216 | string_to_net(top->exec_postrun, o->exec_postrun); | |
217 | string_to_net(top->ioscheduler, o->ioscheduler); | |
218 | string_to_net(top->profile, o->profile); | |
219 | string_to_net(top->cgroup, o->cgroup); | |
220 | ||
221 | top->td_ddir = cpu_to_le32(o->td_ddir); | |
222 | top->rw_seq = cpu_to_le32(o->rw_seq); | |
223 | top->kb_base = cpu_to_le32(o->kb_base); | |
224 | top->ddir_seq_nr = cpu_to_le32(o->ddir_seq_nr); | |
225 | top->iodepth = cpu_to_le32(o->iodepth); | |
226 | top->iodepth_low = cpu_to_le32(o->iodepth_low); | |
227 | top->iodepth_batch = cpu_to_le32(o->iodepth_batch); | |
228 | top->iodepth_batch_complete = cpu_to_le32(o->iodepth_batch_complete); | |
229 | top->size_percent = cpu_to_le32(o->size_percent); | |
230 | top->fill_device = cpu_to_le32(o->fill_device); | |
231 | top->ratecycle = cpu_to_le32(o->ratecycle); | |
232 | top->nr_files = cpu_to_le32(o->nr_files); | |
233 | top->open_files = cpu_to_le32(o->open_files); | |
234 | top->file_lock_mode = cpu_to_le32(o->file_lock_mode); | |
235 | top->lockfile_batch = cpu_to_le32(o->lockfile_batch); | |
236 | top->odirect = cpu_to_le32(o->odirect); | |
237 | top->invalidate_cache = cpu_to_le32(o->invalidate_cache); | |
238 | top->create_serialize = cpu_to_le32(o->create_serialize); | |
239 | top->create_fsync = cpu_to_le32(o->create_fsync); | |
240 | top->create_on_open = cpu_to_le32(o->create_on_open); | |
241 | top->end_fsync = cpu_to_le32(o->end_fsync); | |
242 | top->pre_read = cpu_to_le32(o->pre_read); | |
243 | top->sync_io = cpu_to_le32(o->sync_io); | |
244 | top->verify = cpu_to_le32(o->verify); | |
245 | top->do_verify = cpu_to_le32(o->do_verify); | |
246 | top->verifysort = cpu_to_le32(o->verifysort); | |
247 | top->verify_interval = cpu_to_le32(o->verify_interval); | |
248 | top->verify_offset = cpu_to_le32(o->verify_offset); | |
249 | top->verify_pattern_bytes = cpu_to_le32(o->verify_pattern_bytes); | |
250 | top->verify_fatal = cpu_to_le32(o->verify_fatal); | |
251 | top->verify_dump = cpu_to_le32(o->verify_dump); | |
252 | top->verify_async = cpu_to_le32(o->verify_async); | |
253 | top->verify_batch = cpu_to_le32(o->verify_batch); | |
254 | top->use_thread = cpu_to_le32(o->use_thread); | |
255 | top->unlink = cpu_to_le32(o->unlink); | |
256 | top->do_disk_util = cpu_to_le32(o->do_disk_util); | |
257 | top->override_sync = cpu_to_le32(o->override_sync); | |
258 | top->rand_repeatable = cpu_to_le32(o->rand_repeatable); | |
259 | top->use_os_rand = cpu_to_le32(o->use_os_rand); | |
260 | top->write_lat_log = cpu_to_le32(o->write_lat_log); | |
261 | top->write_bw_log = cpu_to_le32(o->write_bw_log); | |
262 | top->write_iops_log = cpu_to_le32(o->write_iops_log); | |
263 | top->log_avg_msec = cpu_to_le32(o->log_avg_msec); | |
264 | top->norandommap = cpu_to_le32(o->norandommap); | |
265 | top->softrandommap = cpu_to_le32(o->softrandommap); | |
266 | top->bs_unaligned = cpu_to_le32(o->bs_unaligned); | |
267 | top->fsync_on_close = cpu_to_le32(o->fsync_on_close); | |
268 | top->hugepage_size = cpu_to_le32(o->hugepage_size); | |
269 | top->rw_min_bs = cpu_to_le32(o->rw_min_bs); | |
270 | top->thinktime = cpu_to_le32(o->thinktime); | |
271 | top->thinktime_spin = cpu_to_le32(o->thinktime_spin); | |
272 | top->thinktime_blocks = cpu_to_le32(o->thinktime_blocks); | |
273 | top->fsync_blocks = cpu_to_le32(o->fsync_blocks); | |
274 | top->fdatasync_blocks = cpu_to_le32(o->fdatasync_blocks); | |
275 | top->barrier_blocks = cpu_to_le32(o->barrier_blocks); | |
276 | top->overwrite = cpu_to_le32(o->overwrite); | |
277 | top->bw_avg_time = cpu_to_le32(o->bw_avg_time); | |
278 | top->iops_avg_time = cpu_to_le32(o->iops_avg_time); | |
279 | top->loops = cpu_to_le32(o->loops); | |
280 | top->mem_type = cpu_to_le32(o->mem_type); | |
281 | top->mem_align = cpu_to_le32(o->mem_align); | |
282 | top->stonewall = cpu_to_le32(o->stonewall); | |
283 | top->new_group = cpu_to_le32(o->new_group); | |
284 | top->numjobs = cpu_to_le32(o->numjobs); | |
285 | top->cpumask_set = cpu_to_le32(o->cpumask_set); | |
286 | top->verify_cpumask_set = cpu_to_le32(o->verify_cpumask_set); | |
287 | top->iolog = cpu_to_le32(o->iolog); | |
288 | top->rwmixcycle = cpu_to_le32(o->rwmixcycle); | |
289 | top->nice = cpu_to_le32(o->nice); | |
290 | top->file_service_type = cpu_to_le32(o->file_service_type); | |
291 | top->group_reporting = cpu_to_le32(o->group_reporting); | |
292 | top->fadvise_hint = cpu_to_le32(o->fadvise_hint); | |
293 | top->fallocate_mode = cpu_to_le32(o->fallocate_mode); | |
294 | top->zero_buffers = cpu_to_le32(o->zero_buffers); | |
295 | top->refill_buffers = cpu_to_le32(o->refill_buffers); | |
296 | top->scramble_buffers = cpu_to_le32(o->scramble_buffers); | |
297 | top->time_based = cpu_to_le32(o->time_based); | |
298 | top->disable_lat = cpu_to_le32(o->disable_lat); | |
299 | top->disable_clat = cpu_to_le32(o->disable_clat); | |
300 | top->disable_slat = cpu_to_le32(o->disable_slat); | |
301 | top->disable_bw = cpu_to_le32(o->disable_bw); | |
302 | top->gtod_reduce = cpu_to_le32(o->gtod_reduce); | |
303 | top->gtod_cpu = cpu_to_le32(o->gtod_cpu); | |
304 | top->gtod_offload = cpu_to_le32(o->gtod_offload); | |
305 | top->clocksource = cpu_to_le32(o->clocksource); | |
306 | top->no_stall = cpu_to_le32(o->no_stall); | |
307 | top->trim_percentage = cpu_to_le32(o->trim_percentage); | |
308 | top->trim_batch = cpu_to_le32(o->trim_batch); | |
309 | top->trim_zero = cpu_to_le32(o->trim_zero); | |
310 | top->clat_percentiles = cpu_to_le32(o->clat_percentiles); | |
311 | top->overwrite_plist = cpu_to_le32(o->overwrite_plist); | |
312 | top->cpuload = cpu_to_le32(o->cpuload); | |
313 | top->cpucycle = cpu_to_le32(o->cpucycle); | |
314 | top->continue_on_error = cpu_to_le32(o->continue_on_error); | |
315 | top->cgroup_weight = cpu_to_le32(o->cgroup_weight); | |
316 | top->cgroup_nodelete = cpu_to_le32(o->cgroup_nodelete); | |
317 | top->uid = cpu_to_le32(o->uid); | |
318 | top->gid = cpu_to_le32(o->gid); | |
319 | top->flow_id = __cpu_to_le32(o->flow_id); | |
320 | top->flow = __cpu_to_le32(o->flow); | |
321 | top->flow_watermark = __cpu_to_le32(o->flow_watermark); | |
322 | top->flow_sleep = cpu_to_le32(o->flow_sleep); | |
323 | top->sync_file_range = cpu_to_le32(o->sync_file_range); | |
324 | ||
325 | for (i = 0; i < 2; i++) { | |
326 | top->bs[i] = cpu_to_le32(o->bs[i]); | |
327 | top->ba[i] = cpu_to_le32(o->ba[i]); | |
328 | top->min_bs[i] = cpu_to_le32(o->min_bs[i]); | |
329 | top->max_bs[i] = cpu_to_le32(o->max_bs[i]); | |
330 | top->bssplit_nr[i] = cpu_to_le32(o->bssplit_nr[i]); | |
331 | ||
332 | if (o->bssplit_nr[i]) { | |
333 | unsigned int bssplit_nr = o->bssplit_nr[i]; | |
334 | ||
335 | if (bssplit_nr > BSSPLIT_MAX) { | |
336 | log_err("fio: BSSPLIT_MAX is too small\n"); | |
337 | bssplit_nr = BSSPLIT_MAX; | |
338 | } | |
339 | for (j = 0; j < bssplit_nr; j++) { | |
340 | top->bssplit[i][j].bs = cpu_to_le32(o->bssplit[i][j].bs); | |
341 | top->bssplit[i][j].perc = cpu_to_le32(o->bssplit[i][j].perc); | |
342 | } | |
343 | } | |
344 | ||
345 | top->rwmix[i] = cpu_to_le32(o->rwmix[i]); | |
346 | top->rate[i] = cpu_to_le32(o->rate[i]); | |
347 | top->ratemin[i] = cpu_to_le32(o->ratemin[i]); | |
348 | top->rate_iops[i] = cpu_to_le32(o->rate_iops[i]); | |
349 | top->rate_iops_min[i] = cpu_to_le32(o->rate_iops_min[i]); | |
350 | } | |
351 | ||
352 | memcpy(top->verify_pattern, o->verify_pattern, MAX_PATTERN_SIZE); | |
353 | ||
354 | top->size = __cpu_to_le64(o->size); | |
355 | top->verify_backlog = __cpu_to_le64(o->verify_backlog); | |
356 | top->start_delay = __cpu_to_le64(o->start_delay); | |
357 | top->timeout = __cpu_to_le64(o->timeout); | |
358 | top->ramp_time = __cpu_to_le64(o->ramp_time); | |
359 | top->zone_range = __cpu_to_le64(o->zone_range); | |
360 | top->zone_size = __cpu_to_le64(o->zone_size); | |
361 | top->zone_skip = __cpu_to_le64(o->zone_skip); | |
362 | top->ddir_seq_add = __cpu_to_le64(o->ddir_seq_add); | |
363 | top->file_size_low = __cpu_to_le64(o->file_size_low); | |
364 | top->file_size_high = __cpu_to_le64(o->file_size_high); | |
365 | top->start_offset = __cpu_to_le64(o->start_offset); | |
366 | top->trim_backlog = __cpu_to_le64(o->trim_backlog); | |
367 | ||
368 | for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++) | |
369 | top->percentile_list[i].u.i = __cpu_to_le64(fio_double_to_uint64(o->percentile_list[i].u.f)); | |
370 | #if 0 | |
371 | uint8_t cpumask[FIO_TOP_STR_MAX]; | |
372 | uint8_t verify_cpumask[FIO_TOP_STR_MAX]; | |
373 | #endif | |
374 | ||
375 | } | |
376 | ||
51167799 JA |
377 | /* |
378 | * Basic conversion test. We'd really need to fill in more of the options | |
379 | * to have a thorough test. Even better, we should auto-generate the | |
380 | * converter functions... | |
381 | */ | |
382 | int fio_test_cconv(struct thread_options *__o) | |
383 | { | |
384 | struct thread_options o; | |
385 | struct thread_options_pack top1, top2; | |
386 | ||
387 | memset(&top1, 0, sizeof(top1)); | |
388 | memset(&top2, 0, sizeof(top2)); | |
389 | ||
390 | convert_thread_options_to_net(&top1, __o); | |
391 | memset(&o, 0, sizeof(o)); | |
392 | convert_thread_options_to_cpu(&o, &top1); | |
393 | convert_thread_options_to_net(&top2, &o); | |
394 | ||
395 | return memcmp(&top1, &top2, sizeof(top1)); | |
396 | } |