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