projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
init: fix leak bug fix from commit 60c5ec73
[fio.git]
/
stat.c
diff --git
a/stat.c
b/stat.c
index 4529f6948bcb5bb64a938fdfe66a7a1b57992a21..fbf0118c6d7ae1a4a895dc450cf808be7db4041c 100644
(file)
--- a/
stat.c
+++ b/
stat.c
@@
-770,7
+770,7
@@
static void add_ddir_status_json(struct thread_stat *ts,
}
json_object_add_value_int(dir_object, "bw_min", min);
json_object_add_value_int(dir_object, "bw_max", max);
}
json_object_add_value_int(dir_object, "bw_min", min);
json_object_add_value_int(dir_object, "bw_max", max);
- json_object_add_value_float(dir_object, "bw_agg",
mean
);
+ json_object_add_value_float(dir_object, "bw_agg",
p_of_agg
);
json_object_add_value_float(dir_object, "bw_mean", mean);
json_object_add_value_float(dir_object, "bw_dev", dev);
}
json_object_add_value_float(dir_object, "bw_mean", mean);
json_object_add_value_float(dir_object, "bw_dev", dev);
}
@@
-831,7
+831,7
@@
static void show_thread_status_terse_v2(struct thread_stat *ts,
log_info("\n");
/* Additional output if description is set */
log_info("\n");
/* Additional output if description is set */
- if (
ts->description
)
+ if (
strlen(ts->description)
)
log_info(";%s", ts->description);
log_info("\n");
log_info(";%s", ts->description);
log_info("\n");
@@
-1471,7
+1471,12
@@
void show_running_run_stats(void)
fio_mutex_down(stat_mutex);
if (!pthread_create(&thread, NULL, __show_running_run_stats, NULL)) {
fio_mutex_down(stat_mutex);
if (!pthread_create(&thread, NULL, __show_running_run_stats, NULL)) {
- pthread_detach(thread);
+ int err;
+
+ err = pthread_detach(thread);
+ if (err)
+ log_err("fio: DU thread detach failed: %s\n", strerror(err));
+
return;
}
return;
}
@@
-1494,8
+1499,11
@@
static int check_status_file(void)
return 0;
temp_dir = getenv("TMPDIR");
return 0;
temp_dir = getenv("TMPDIR");
- if (temp_dir == NULL)
+ if (temp_dir == NULL)
{
temp_dir = getenv("TEMP");
temp_dir = getenv("TEMP");
+ if (temp_dir && strlen(temp_dir) >= PATH_MAX)
+ temp_dir = NULL;
+ }
if (temp_dir == NULL)
temp_dir = "/tmp";
if (temp_dir == NULL)
temp_dir = "/tmp";
@@
-1800,7
+1808,11
@@
void add_bw_sample(struct thread_data *td, enum fio_ddir ddir, unsigned int bs,
if (!delta)
continue; /* No entries for interval */
if (!delta)
continue; /* No entries for interval */
- rate = delta * 1000 / spent / 1024;
+ if (spent)
+ rate = delta * 1000 / spent / 1024;
+ else
+ rate = 0;
+
add_stat_sample(&ts->bw_stat[ddir], rate);
if (td->bw_log)
add_stat_sample(&ts->bw_stat[ddir], rate);
if (td->bw_log)
@@
-1835,7
+1847,11
@@
void add_iops_sample(struct thread_data *td, enum fio_ddir ddir, unsigned int bs
if (!delta)
continue; /* No entries for interval */
if (!delta)
continue; /* No entries for interval */
- iops = (delta * 1000) / spent;
+ if (spent)
+ iops = (delta * 1000) / spent;
+ else
+ iops = 0;
+
add_stat_sample(&ts->iops_stat[ddir], iops);
if (td->iops_log)
add_stat_sample(&ts->iops_stat[ddir], iops);
if (td->iops_log)