projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
e4defrag: pass 'error' into td_verror()
[fio.git]
/
stat.c
diff --git
a/stat.c
b/stat.c
index f84ce5300f605736b5ef8b9556286792b2b53cd8..1ef88ddf69884b083c229032c08fb9df8b6f63cb 100644
(file)
--- a/
stat.c
+++ b/
stat.c
@@
-497,7
+497,8
@@
static void show_latencies(struct thread_stat *ts)
show_lat_m(io_u_lat_m);
}
show_lat_m(io_u_lat_m);
}
-void show_thread_status_normal(struct thread_stat *ts, struct group_run_stats *rs)
+static void show_thread_status_normal(struct thread_stat *ts,
+ struct group_run_stats *rs)
{
double usr_cpu, sys_cpu;
unsigned long runtime;
{
double usr_cpu, sys_cpu;
unsigned long runtime;
@@
-769,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);
}
@@
-830,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");
@@
-1012,7
+1013,7
@@
struct json_object *show_thread_status(struct thread_stat *ts,
if (output_format == FIO_OUTPUT_TERSE)
show_thread_status_terse(ts, rs);
else if (output_format == FIO_OUTPUT_JSON)
if (output_format == FIO_OUTPUT_TERSE)
show_thread_status_terse(ts, rs);
else if (output_format == FIO_OUTPUT_JSON)
- return
(show_thread_status_json(ts, rs)
);
+ return
show_thread_status_json(ts, rs
);
else
show_thread_status_normal(ts, rs);
return NULL;
else
show_thread_status_normal(ts, rs);
return NULL;
@@
-1493,8
+1494,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";
@@
-1799,7
+1803,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)
@@
-1834,7
+1842,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)