X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=cconv.c;h=b7d469e920141f862a33b5ee91f341195bbb7194;hb=6a7a92156a09ff66fd3e0ea062f2cdb339ca73c5;hp=82383b2dedfc32a6bb7aed75c1390642123b5196;hpb=d01612f3ae2515eb035d0c4ce954d8cb167a0a61;p=fio.git diff --git a/cconv.c b/cconv.c index 82383b2d..b7d469e9 100644 --- a/cconv.c +++ b/cconv.c @@ -18,6 +18,29 @@ static void string_to_net(uint8_t *dst, const char *src) dst[0] = '\0'; } +void free_thread_options_to_cpu(struct thread_options *o) +{ + free(o->description); + free(o->name); + free(o->directory); + free(o->filename); + free(o->filename_format); + free(o->opendir); + free(o->ioengine); + free(o->mmapfile); + free(o->read_iolog_file); + free(o->write_iolog_file); + free(o->bw_log_file); + free(o->lat_log_file); + free(o->iops_log_file); + free(o->replay_redirect); + free(o->exec_prerun); + free(o->exec_postrun); + free(o->ioscheduler); + free(o->profile); + free(o->cgroup); +} + void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top) { @@ -107,6 +130,7 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->verify_offset = le32_to_cpu(top->verify_offset); memcpy(o->verify_pattern, top->verify_pattern, MAX_PATTERN_SIZE); + memcpy(o->buffer_pattern, top->buffer_pattern, MAX_PATTERN_SIZE); o->verify_pattern_bytes = le32_to_cpu(top->verify_pattern_bytes); o->verify_fatal = le32_to_cpu(top->verify_fatal); @@ -118,6 +142,7 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->do_disk_util = le32_to_cpu(top->do_disk_util); o->override_sync = le32_to_cpu(top->override_sync); o->rand_repeatable = le32_to_cpu(top->rand_repeatable); + o->rand_seed = le64_to_cpu(top->rand_seed); o->use_os_rand = le32_to_cpu(top->use_os_rand); o->log_avg_msec = le32_to_cpu(top->log_avg_msec); o->norandommap = le32_to_cpu(top->norandommap); @@ -173,6 +198,7 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->zero_buffers = le32_to_cpu(top->zero_buffers); o->refill_buffers = le32_to_cpu(top->refill_buffers); o->scramble_buffers = le32_to_cpu(top->scramble_buffers); + o->buffer_pattern_bytes = le32_to_cpu(top->buffer_pattern_bytes); o->time_based = le32_to_cpu(top->time_based); o->disable_lat = le32_to_cpu(top->disable_lat); o->disable_clat = le32_to_cpu(top->disable_clat); @@ -199,6 +225,9 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->flow_watermark = __le32_to_cpu(top->flow_watermark); o->flow_sleep = le32_to_cpu(top->flow_sleep); o->sync_file_range = le32_to_cpu(top->sync_file_range); + o->latency_target = le64_to_cpu(top->latency_target); + o->latency_window = le64_to_cpu(top->latency_window); + o->latency_percentile.u.f = fio_uint64_to_double(le64_to_cpu(top->latency_percentile.u.i)); o->compress_percentage = le32_to_cpu(top->compress_percentage); o->compress_chunk = le32_to_cpu(top->compress_chunk); @@ -279,6 +308,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->do_disk_util = cpu_to_le32(o->do_disk_util); top->override_sync = cpu_to_le32(o->override_sync); top->rand_repeatable = cpu_to_le32(o->rand_repeatable); + top->rand_seed = __cpu_to_le64(o->rand_seed); top->use_os_rand = cpu_to_le32(o->use_os_rand); top->log_avg_msec = cpu_to_le32(o->log_avg_msec); top->norandommap = cpu_to_le32(o->norandommap); @@ -322,6 +352,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->zero_buffers = cpu_to_le32(o->zero_buffers); top->refill_buffers = cpu_to_le32(o->refill_buffers); top->scramble_buffers = cpu_to_le32(o->scramble_buffers); + top->buffer_pattern_bytes = cpu_to_le32(o->buffer_pattern_bytes); top->time_based = cpu_to_le32(o->time_based); top->disable_lat = cpu_to_le32(o->disable_lat); top->disable_clat = cpu_to_le32(o->disable_clat); @@ -348,6 +379,9 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->flow_watermark = __cpu_to_le32(o->flow_watermark); top->flow_sleep = cpu_to_le32(o->flow_sleep); top->sync_file_range = cpu_to_le32(o->sync_file_range); + top->latency_target = __cpu_to_le64(o->latency_target); + top->latency_window = __cpu_to_le64(o->latency_window); + top->latency_percentile.u.i = __cpu_to_le64(fio_double_to_uint64(o->latency_percentile.u.f)); top->compress_percentage = cpu_to_le32(o->compress_percentage); top->compress_chunk = cpu_to_le32(o->compress_chunk); @@ -381,6 +415,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, } memcpy(top->verify_pattern, o->verify_pattern, MAX_PATTERN_SIZE); + memcpy(top->buffer_pattern, o->buffer_pattern, MAX_PATTERN_SIZE); top->size = __cpu_to_le64(o->size); top->verify_backlog = __cpu_to_le64(o->verify_backlog); @@ -426,5 +461,7 @@ int fio_test_cconv(struct thread_options *__o) convert_thread_options_to_cpu(&o, &top1); convert_thread_options_to_net(&top2, &o); + free_thread_options_to_cpu(&o); + return memcmp(&top1, &top2, sizeof(top1)); }