+static void fio_client_json_init(void)
+{
+ if (output_format != FIO_OUTPUT_JSON)
+ return;
+ root = json_create_object();
+ json_object_add_value_string(root, "fio version", fio_version_string);
+ clients_array = json_create_array();
+ json_object_add_value_array(root, "client_stats", clients_array);
+ du_array = json_create_array();
+ json_object_add_value_array(root, "disk_util", du_array);
+}
+
+static void fio_client_json_fini(void)
+{
+ if (output_format != FIO_OUTPUT_JSON)
+ return;
+ json_print_object(root);
+ log_info("\n");
+ json_free_object(root);
+ root = NULL;
+ clients_array = NULL;
+ du_array = NULL;
+}
+