projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
engines/libblkio: Add option libblkio_wait_mode
[fio.git]
/
stat.c
diff --git
a/stat.c
b/stat.c
index 24fc679fa1c39d7f79db798c9175b58f559139a8..b963973a5824c09663917e994bda0a7f6cb21145 100644
(file)
--- a/
stat.c
+++ b/
stat.c
@@
-1,5
+1,6
@@
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <math.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <math.h>
@@
-377,7
+378,7
@@
void show_group_stats(struct group_run_stats *rs, struct buf_output *out)
free(maxalt);
}
free(maxalt);
}
- /* Need to aggregate statis
i
tics to show mixed values */
+ /* Need to aggregate statistics to show mixed values */
if (rs->unified_rw_rep == UNIFIED_BOTH)
show_mixed_group_stats(rs, out);
}
if (rs->unified_rw_rep == UNIFIED_BOTH)
show_mixed_group_stats(rs, out);
}
@@
-1698,6
+1699,7
@@
static struct json_object *show_thread_status_json(struct thread_stat *ts,
if (je) {
json_object_add_value_int(root, "eta", je->eta_sec);
json_object_add_value_int(root, "elapsed", je->elapsed_sec);
if (je) {
json_object_add_value_int(root, "eta", je->eta_sec);
json_object_add_value_int(root, "elapsed", je->elapsed_sec);
+ free(je);
}
if (opt_list)
}
if (opt_list)
@@
-2041,6
+2043,9
@@
void free_clat_prio_stats(struct thread_stat *ts)
{
enum fio_ddir ddir;
{
enum fio_ddir ddir;
+ if (!ts)
+ return;
+
for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
sfree(ts->clat_prio[ddir]);
ts->clat_prio[ddir] = NULL;
for (ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++) {
sfree(ts->clat_prio[ddir]);
ts->clat_prio[ddir] = NULL;
@@
-2728,6
+2733,9
@@
int __show_running_run_stats(void)
fio_gettime(&ts, NULL);
for_each_td(td, i) {
fio_gettime(&ts, NULL);
for_each_td(td, i) {
+ if (td->runstate >= TD_EXITED)
+ continue;
+
td->update_rusage = 1;
for_each_rw_ddir(ddir) {
td->ts.io_bytes[ddir] = td->io_bytes[ddir];
td->update_rusage = 1;
for_each_rw_ddir(ddir) {
td->ts.io_bytes[ddir] = td->io_bytes[ddir];
@@
-2756,6
+2764,9
@@
int __show_running_run_stats(void)
__show_run_stats();
for_each_td(td, i) {
__show_run_stats();
for_each_td(td, i) {
+ if (td->runstate >= TD_EXITED)
+ continue;
+
if (td_read(td) && td->ts.io_bytes[DDIR_READ])
td->ts.runtime[DDIR_READ] -= rt[i];
if (td_write(td) && td->ts.io_bytes[DDIR_WRITE])
if (td_read(td) && td->ts.io_bytes[DDIR_READ])
td->ts.runtime[DDIR_READ] -= rt[i];
if (td_write(td) && td->ts.io_bytes[DDIR_WRITE])
@@
-2859,7
+2870,10
@@
static struct io_logs *get_new_log(struct io_log *iolog)
* forever
*/
if (!iolog->cur_log_max) {
* forever
*/
if (!iolog->cur_log_max) {
- new_samples = iolog->td->o.log_entries;
+ if (iolog->td)
+ new_samples = iolog->td->o.log_entries;
+ else
+ new_samples = DEF_LOG_ENTRIES;
} else {
new_samples = iolog->cur_log_max * 2;
if (new_samples > MAX_LOG_ENTRIES)
} else {
new_samples = iolog->cur_log_max * 2;
if (new_samples > MAX_LOG_ENTRIES)
@@
-3017,7
+3031,7
@@
static void __add_log_sample(struct io_log *iolog, union io_sample_data data,
s = get_sample(iolog, cur_log, cur_log->nr_samples);
s->data = data;
s = get_sample(iolog, cur_log, cur_log->nr_samples);
s->data = data;
- s->time = t + (iolog->td ? iolog->td->
unix
_epoch : 0);
+ s->time = t + (iolog->td ? iolog->td->
alternate
_epoch : 0);
io_sample_set_ddir(iolog, s, ddir);
s->bs = bs;
s->priority = priority;
io_sample_set_ddir(iolog, s, ddir);
s->bs = bs;
s->priority = priority;