- if (td->ts.bw_log)
- finish_log(td, td->ts.bw_log, "bw");
- if (td->ts.slat_log)
- finish_log(td, td->ts.slat_log, "slat");
- if (td->ts.clat_log)
- finish_log(td, td->ts.clat_log, "clat");
- if (td->o.exec_postrun) {
- if (system(td->o.exec_postrun) < 0)
- log_err("fio: postrun %s failed\n", td->o.exec_postrun);
+ fio_mutex_down(writeout_mutex);
+ if (td->ts.bw_log) {
+ if (td->o.bw_log_file) {
+ finish_log_named(td, td->ts.bw_log,
+ td->o.bw_log_file, "bw");
+ } else
+ finish_log(td, td->ts.bw_log, "bw");
+ }
+ if (td->ts.lat_log) {
+ if (td->o.lat_log_file) {
+ finish_log_named(td, td->ts.lat_log,
+ td->o.lat_log_file, "lat");
+ } else
+ finish_log(td, td->ts.lat_log, "lat");
+ }
+ if (td->ts.slat_log) {
+ if (td->o.lat_log_file) {
+ finish_log_named(td, td->ts.slat_log,
+ td->o.lat_log_file, "slat");
+ } else
+ finish_log(td, td->ts.slat_log, "slat");
+ }
+ if (td->ts.clat_log) {
+ if (td->o.lat_log_file) {
+ finish_log_named(td, td->ts.clat_log,
+ td->o.lat_log_file, "clat");
+ } else
+ finish_log(td, td->ts.clat_log, "clat");