* [PATCH 1/4] stat: Print one-line iops stat
2017-06-23 22:27 [PATCH v4 0/4] stat: Modify info for bw and add iops stats Andreas Herrmann
@ 2017-06-23 22:27 ` Andreas Herrmann
2017-06-26 14:30 ` Elliott, Robert (Persistent Memory)
2017-06-23 22:27 ` [PATCH 2/4] stat: Print number of samples in bw and iops stats Andreas Herrmann
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Andreas Herrmann @ 2017-06-23 22:27 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio
This adds basic iops statistics (likewise to what we already have for
bandwidth) to normal and json fio output. Example for normal output:
bw ( KiB/s): min=42192, max=162068, per=0.10%, avg=93236.21, stdev=22180.02
iops : min=21090, max=81020, avg=46606.84, stdev=11088.40
lat (usec) : 2=55.13%, 4=21.11%, 10=0.36%, 20=0.03%, 50=23.14%
Added handling for iops_stat to client/server and bump server version.
Signed-off-by: Andreas Herrmann <aherrmann@suse.com>
---
client.c | 1 +
init.c | 1 +
server.c | 1 +
server.h | 2 +-
stat.c | 16 ++++++++++++++++
5 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/client.c b/client.c
index 7a986aae..4da4a275 100644
--- a/client.c
+++ b/client.c
@@ -885,6 +885,7 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
convert_io_stat(&dst->slat_stat[i], &src->slat_stat[i]);
convert_io_stat(&dst->lat_stat[i], &src->lat_stat[i]);
convert_io_stat(&dst->bw_stat[i], &src->bw_stat[i]);
+ convert_io_stat(&dst->iops_stat[i], &src->iops_stat[i]);
}
dst->usr_time = le64_to_cpu(src->usr_time);
diff --git a/init.c b/init.c
index 2b7768ab..b8e97f09 100644
--- a/init.c
+++ b/init.c
@@ -1364,6 +1364,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
td->ts.slat_stat[i].min_val = ULONG_MAX;
td->ts.lat_stat[i].min_val = ULONG_MAX;
td->ts.bw_stat[i].min_val = ULONG_MAX;
+ td->ts.iops_stat[i].min_val = ULONG_MAX;
}
td->ddir_seq_nr = o->ddir_seq_nr;
diff --git a/server.c b/server.c
index 8b36e383..e66a5f04 100644
--- a/server.c
+++ b/server.c
@@ -1474,6 +1474,7 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
convert_io_stat(&p.ts.slat_stat[i], &ts->slat_stat[i]);
convert_io_stat(&p.ts.lat_stat[i], &ts->lat_stat[i]);
convert_io_stat(&p.ts.bw_stat[i], &ts->bw_stat[i]);
+ convert_io_stat(&p.ts.iops_stat[i], &ts->iops_stat[i]);
}
p.ts.usr_time = cpu_to_le64(ts->usr_time);
diff --git a/server.h b/server.h
index 7f235f3d..f63a5185 100644
--- a/server.h
+++ b/server.h
@@ -49,7 +49,7 @@ struct fio_net_cmd_reply {
};
enum {
- FIO_SERVER_VER = 64,
+ FIO_SERVER_VER = 65,
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
FIO_SERVER_MAX_CMD_MB = 2048,
diff --git a/stat.c b/stat.c
index 50426509..d519ee9e 100644
--- a/stat.c
+++ b/stat.c
@@ -499,6 +499,10 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts,
log_buf(out, " bw (%5s/s): min=%5llu, max=%5llu, per=%3.2f%%, avg=%5.02f, stdev=%5.02f\n",
bw_str, min, max, p_of_agg, mean, dev);
}
+ if (calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev)) {
+ log_buf(out, " iops : min=%5llu, max=%5llu, avg=%5.02f, "
+ "stdev=%5.02f\n", min, max, mean, dev);
+ }
}
static int show_lat(double *io_u_lat, int nr, const char **ranges,
@@ -1047,6 +1051,15 @@ static void add_ddir_status_json(struct thread_stat *ts,
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);
+
+ if (!calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev)) {
+ min = max = 0;
+ mean = dev = 0.0;
+ }
+ json_object_add_value_int(dir_object, "iops_min", min);
+ json_object_add_value_int(dir_object, "iops_max", max);
+ json_object_add_value_float(dir_object, "iops_mean", mean);
+ json_object_add_value_float(dir_object, "iops_stddev", dev);
}
static void show_thread_status_terse_v2(struct thread_stat *ts,
@@ -1507,6 +1520,7 @@ void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src,
sum_stat(&dst->slat_stat[l], &src->slat_stat[l], first);
sum_stat(&dst->lat_stat[l], &src->lat_stat[l], first);
sum_stat(&dst->bw_stat[l], &src->bw_stat[l], first);
+ sum_stat(&dst->iops_stat[l], &src->iops_stat[l], first);
dst->io_bytes[l] += src->io_bytes[l];
@@ -1517,6 +1531,7 @@ void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src,
sum_stat(&dst->slat_stat[0], &src->slat_stat[l], first);
sum_stat(&dst->lat_stat[0], &src->lat_stat[l], first);
sum_stat(&dst->bw_stat[0], &src->bw_stat[l], first);
+ sum_stat(&dst->iops_stat[0], &src->iops_stat[l], first);
dst->io_bytes[0] += src->io_bytes[l];
@@ -1598,6 +1613,7 @@ void init_thread_stat(struct thread_stat *ts)
ts->clat_stat[j].min_val = -1UL;
ts->slat_stat[j].min_val = -1UL;
ts->bw_stat[j].min_val = -1UL;
+ ts->iops_stat[j].min_val = -1UL;
}
ts->groupid = -1;
}
--
2.12.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* RE: [PATCH 1/4] stat: Print one-line iops stat
2017-06-23 22:27 ` [PATCH 1/4] stat: Print one-line iops stat Andreas Herrmann
@ 2017-06-26 14:30 ` Elliott, Robert (Persistent Memory)
2017-06-26 14:52 ` Jens Axboe
0 siblings, 1 reply; 11+ messages in thread
From: Elliott, Robert (Persistent Memory) @ 2017-06-26 14:30 UTC (permalink / raw)
To: Andreas Herrmann, Jens Axboe; +Cc: fio@vger.kernel.org
> -----Original Message-----
> From: fio-owner@vger.kernel.org [mailto:fio-owner@vger.kernel.org] On
> Behalf Of Andreas Herrmann
> Sent: Friday, June 23, 2017 5:28 PM
> To: Jens Axboe <axboe@fb.com>
> Cc: fio@vger.kernel.org
> Subject: [PATCH 1/4] stat: Print one-line iops stat
>
> This adds basic iops statistics (likewise to what we already have for
> bandwidth) to normal and json fio output. Example for normal output:
>
> bw ( KiB/s): min=42192, max=162068, per=0.10%, avg=93236.21,
> stdev=22180.02
> iops : min=21090, max=81020, avg=46606.84, stdev=11088.40
> lat (usec) : 2=55.13%, 4=21.11%, 10=0.36%, 20=0.03%, 50=23.14%
...
> + log_buf(out, " iops : min=%5llu, max=%5llu, avg=%5.02f, "
> + "stdev=%5.02f\n", min, max, mean, dev);
Seven more spaces are needed to line up the : characters in all the rows.
I don't recommending splitting up a quoted string like that either - it
makes it hard to find things with grep.
---
Robert Elliott, HPE Persistent Memory
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/4] stat: Print one-line iops stat
2017-06-26 14:30 ` Elliott, Robert (Persistent Memory)
@ 2017-06-26 14:52 ` Jens Axboe
0 siblings, 0 replies; 11+ messages in thread
From: Jens Axboe @ 2017-06-26 14:52 UTC (permalink / raw)
To: Elliott, Robert (Persistent Memory), Andreas Herrmann; +Cc: fio@vger.kernel.org
On 06/26/2017 08:30 AM, Elliott, Robert (Persistent Memory) wrote:
>
>
>> -----Original Message-----
>> From: fio-owner@vger.kernel.org [mailto:fio-owner@vger.kernel.org] On
>> Behalf Of Andreas Herrmann
>> Sent: Friday, June 23, 2017 5:28 PM
>> To: Jens Axboe <axboe@fb.com>
>> Cc: fio@vger.kernel.org
>> Subject: [PATCH 1/4] stat: Print one-line iops stat
>>
>> This adds basic iops statistics (likewise to what we already have for
>> bandwidth) to normal and json fio output. Example for normal output:
>>
>> bw ( KiB/s): min=42192, max=162068, per=0.10%, avg=93236.21,
>> stdev=22180.02
>> iops : min=21090, max=81020, avg=46606.84, stdev=11088.40
>> lat (usec) : 2=55.13%, 4=21.11%, 10=0.36%, 20=0.03%, 50=23.14%
> ...
>> + log_buf(out, " iops : min=%5llu, max=%5llu, avg=%5.02f, "
>> + "stdev=%5.02f\n", min, max, mean, dev);
>
> Seven more spaces are needed to line up the : characters in all the rows.
Good catch, I fixed that up.
--
Jens Axboe
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/4] stat: Print number of samples in bw and iops stats
2017-06-23 22:27 [PATCH v4 0/4] stat: Modify info for bw and add iops stats Andreas Herrmann
2017-06-23 22:27 ` [PATCH 1/4] stat: Print one-line iops stat Andreas Herrmann
@ 2017-06-23 22:27 ` Andreas Herrmann
2017-06-23 22:27 ` [PATCH 3/4] stat: Merge show_thread_status_terse_* functions Andreas Herrmann
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Andreas Herrmann @ 2017-06-23 22:27 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio
This adds the actual number of samples for bw and iops stats printed
in normal and json fio output. Example for normal output:
bw ( MiB/s): min= 120, max= 3304, per=0.10%, avg=2659.34, stdev=1085.25, samples= 109
iops : min=102776, max=830416, avg=675639.05, stdev=280619.99, samples= 21
Note: This example was created using options
"--write_bw_log=... --log_avg_msec=100 --runtime=11s" (ie. no iops log
written). That is why number of samples differs for IOPs and BW.
Signed-off-by: Andreas Herrmann <aherrmann@suse.com>
---
stat.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/stat.c b/stat.c
index d519ee9e..369f9696 100644
--- a/stat.c
+++ b/stat.c
@@ -496,12 +496,15 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts,
bw_str = (rs->unit_base == 1 ? "Mibit" : "MiB");
}
- log_buf(out, " bw (%5s/s): min=%5llu, max=%5llu, per=%3.2f%%, avg=%5.02f, stdev=%5.02f\n",
- bw_str, min, max, p_of_agg, mean, dev);
+ log_buf(out, " bw (%5s/s): min=%5llu, max=%5llu, per=%3.2f%%, "
+ "avg=%5.02f, stdev=%5.02f, samples=%5lu\n",
+ bw_str, min, max, p_of_agg, mean, dev,
+ (&ts->bw_stat[ddir])->samples);
}
if (calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev)) {
log_buf(out, " iops : min=%5llu, max=%5llu, avg=%5.02f, "
- "stdev=%5.02f\n", min, max, mean, dev);
+ "stdev=%5.02f, samples=%5lu\n",
+ min, max, mean, dev, (&ts->iops_stat[ddir])->samples);
}
}
@@ -1051,6 +1054,8 @@ static void add_ddir_status_json(struct thread_stat *ts,
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_int(dir_object, "bw_samples",
+ (&ts->bw_stat[ddir])->samples);
if (!calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev)) {
min = max = 0;
@@ -1060,6 +1065,8 @@ static void add_ddir_status_json(struct thread_stat *ts,
json_object_add_value_int(dir_object, "iops_max", max);
json_object_add_value_float(dir_object, "iops_mean", mean);
json_object_add_value_float(dir_object, "iops_stddev", dev);
+ json_object_add_value_int(dir_object, "iops_samples",
+ (&ts->iops_stat[ddir])->samples);
}
static void show_thread_status_terse_v2(struct thread_stat *ts,
--
2.12.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 3/4] stat: Merge show_thread_status_terse_* functions
2017-06-23 22:27 [PATCH v4 0/4] stat: Modify info for bw and add iops stats Andreas Herrmann
2017-06-23 22:27 ` [PATCH 1/4] stat: Print one-line iops stat Andreas Herrmann
2017-06-23 22:27 ` [PATCH 2/4] stat: Print number of samples in bw and iops stats Andreas Herrmann
@ 2017-06-23 22:27 ` Andreas Herrmann
2017-06-23 22:27 ` [PATCH 4/4] stat: Add iops stat and sample number information to terse format Andreas Herrmann
2017-06-23 22:31 ` [PATCH v4 0/4] stat: Modify info for bw and add iops stats Jens Axboe
4 siblings, 0 replies; 11+ messages in thread
From: Andreas Herrmann @ 2017-06-23 22:27 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio
Merge show_thread_status_terse_v2 and show_thread_status_terse_v3_v4
into new function show_thread_status_terse_all.
Signed-off-by: Andreas Herrmann <aherrmann@suse.com>
---
stat.c | 88 ++++++++++++------------------------------------------------------
1 file changed, 15 insertions(+), 73 deletions(-)
diff --git a/stat.c b/stat.c
index 369f9696..1201c35c 100644
--- a/stat.c
+++ b/stat.c
@@ -1069,9 +1069,9 @@ static void add_ddir_status_json(struct thread_stat *ts,
(&ts->iops_stat[ddir])->samples);
}
-static void show_thread_status_terse_v2(struct thread_stat *ts,
- struct group_run_stats *rs,
- struct buf_output *out)
+static void show_thread_status_terse_all(struct thread_stat *ts,
+ struct group_run_stats *rs, int ver,
+ struct buf_output *out)
{
double io_u_dist[FIO_IO_U_MAP_NR];
double io_u_lat_u[FIO_IO_U_LAT_U_NR];
@@ -1080,77 +1080,18 @@ static void show_thread_status_terse_v2(struct thread_stat *ts,
int i;
/* General Info */
- log_buf(out, "2;%s;%d;%d", ts->name, ts->groupid, ts->error);
- /* Log Read Status */
- show_ddir_status_terse(ts, rs, DDIR_READ, out);
- /* Log Write Status */
- show_ddir_status_terse(ts, rs, DDIR_WRITE, out);
- /* Log Trim Status */
- show_ddir_status_terse(ts, rs, DDIR_TRIM, out);
-
- /* CPU Usage */
- if (ts->total_run_time) {
- double runt = (double) ts->total_run_time;
-
- usr_cpu = (double) ts->usr_time * 100 / runt;
- sys_cpu = (double) ts->sys_time * 100 / runt;
- } else {
- usr_cpu = 0;
- sys_cpu = 0;
- }
-
- log_buf(out, ";%f%%;%f%%;%llu;%llu;%llu", usr_cpu, sys_cpu,
- (unsigned long long) ts->ctx,
- (unsigned long long) ts->majf,
- (unsigned long long) ts->minf);
-
- /* Calc % distribution of IO depths, usecond, msecond latency */
- stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
- stat_calc_lat_nu(ts, io_u_lat_u);
- stat_calc_lat_m(ts, io_u_lat_m);
-
- /* Only show fixed 7 I/O depth levels*/
- log_buf(out, ";%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%",
- io_u_dist[0], io_u_dist[1], io_u_dist[2], io_u_dist[3],
- io_u_dist[4], io_u_dist[5], io_u_dist[6]);
-
- /* Microsecond latency */
- for (i = 0; i < FIO_IO_U_LAT_U_NR; i++)
- log_buf(out, ";%3.2f%%", io_u_lat_u[i]);
- /* Millisecond latency */
- for (i = 0; i < FIO_IO_U_LAT_M_NR; i++)
- log_buf(out, ";%3.2f%%", io_u_lat_m[i]);
- /* Additional output if continue_on_error set - default off*/
- if (ts->continue_on_error)
- log_buf(out, ";%llu;%d", (unsigned long long) ts->total_err_count, ts->first_error);
- log_buf(out, "\n");
-
- /* Additional output if description is set */
- if (strlen(ts->description))
- log_buf(out, ";%s", ts->description);
-
- log_buf(out, "\n");
-}
-
-static void show_thread_status_terse_v3_v4(struct thread_stat *ts,
- struct group_run_stats *rs, int ver,
- struct buf_output *out)
-{
- double io_u_dist[FIO_IO_U_MAP_NR];
- double io_u_lat_u[FIO_IO_U_LAT_U_NR];
- double io_u_lat_m[FIO_IO_U_LAT_M_NR];
- double usr_cpu, sys_cpu;
- int i;
+ if (ver == 2)
+ log_buf(out, "2;%s;%d;%d", ts->name, ts->groupid, ts->error);
+ else
+ log_buf(out, "%d;%s;%s;%d;%d", ver, fio_version_string,
+ ts->name, ts->groupid, ts->error);
- /* General Info */
- log_buf(out, "%d;%s;%s;%d;%d", ver, fio_version_string,
- ts->name, ts->groupid, ts->error);
/* Log Read Status */
show_ddir_status_terse(ts, rs, DDIR_READ, out);
/* Log Write Status */
show_ddir_status_terse(ts, rs, DDIR_WRITE, out);
/* Log Trim Status */
- if (ver == 4)
+ if (ver == 2 || ver == 4)
show_ddir_status_terse(ts, rs, DDIR_TRIM, out);
/* CPU Usage */
@@ -1187,11 +1128,14 @@ static void show_thread_status_terse_v3_v4(struct thread_stat *ts,
log_buf(out, ";%3.2f%%", io_u_lat_m[i]);
/* disk util stats, if any */
- show_disk_util(1, NULL, out);
+ if (ver >= 3)
+ show_disk_util(1, NULL, out);
/* Additional output if continue_on_error set - default off*/
if (ts->continue_on_error)
log_buf(out, ";%llu;%d", (unsigned long long) ts->total_err_count, ts->first_error);
+ if (ver == 2)
+ log_buf(out, "\n");
/* Additional output if description is set */
if (strlen(ts->description))
@@ -1432,10 +1376,8 @@ static void show_thread_status_terse(struct thread_stat *ts,
struct group_run_stats *rs,
struct buf_output *out)
{
- if (terse_version == 2)
- show_thread_status_terse_v2(ts, rs, out);
- else if (terse_version == 3 || terse_version == 4)
- show_thread_status_terse_v3_v4(ts, rs, terse_version, out);
+ if (terse_version >= 2 && terse_version <= 4)
+ show_thread_status_terse_all(ts, rs, terse_version, out);
else
log_err("fio: bad terse version!? %d\n", terse_version);
}
--
2.12.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 4/4] stat: Add iops stat and sample number information to terse format
2017-06-23 22:27 [PATCH v4 0/4] stat: Modify info for bw and add iops stats Andreas Herrmann
` (2 preceding siblings ...)
2017-06-23 22:27 ` [PATCH 3/4] stat: Merge show_thread_status_terse_* functions Andreas Herrmann
@ 2017-06-23 22:27 ` Andreas Herrmann
2017-06-23 22:31 ` [PATCH v4 0/4] stat: Modify info for bw and add iops stats Jens Axboe
4 siblings, 0 replies; 11+ messages in thread
From: Andreas Herrmann @ 2017-06-23 22:27 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio
This is inserted beyond bandwidth information. It required creation
of a new terse version (v5).
Updated man page and HOWTO accordingly. Also added hints when fields
are specific to certain terse versions.
Signed-off-by: Andreas Herrmann <aherrmann@suse.com>
---
HOWTO | 19 +++++++++++++------
fio.1 | 26 ++++++++++++++++++++------
init.c | 3 +--
stat.c | 30 ++++++++++++++++++++++--------
4 files changed, 56 insertions(+), 22 deletions(-)
diff --git a/HOWTO b/HOWTO
index 22c5a5b8..b2db69dc 100644
--- a/HOWTO
+++ b/HOWTO
@@ -127,7 +127,7 @@ Command line options
.. option:: --terse-version=type
- Set terse version output format (default 3, or 2 or 4).
+ Set terse version output format (default 3, or 2 or 4 or 5).
.. option:: --version
@@ -3168,11 +3168,12 @@ first value is the version of the terse output format. If the output has to be
changed for some reason, this number will be incremented by 1 to signify that
change.
-Split up, the format is as follows:
+Split up, the format is as follows (comments in brackets denote when a
+field was introduced or whether its specific to some terse version):
::
- terse version, fio version, jobname, groupid, error
+ terse version, fio version [v3], jobname, groupid, error
READ status::
@@ -3181,7 +3182,8 @@ Split up, the format is as follows:
Completion latency: min, max, mean, stdev (usec)
Completion latency percentiles: 20 fields (see below)
Total latency: min, max, mean, stdev (usec)
- Bw (KiB/s): min, max, aggregate percentage of total, mean, stdev
+ Bw (KiB/s): min, max, aggregate percentage of total, mean, stdev, number of samples [v5]
+ IOPS [v5]: min, max, mean, stdev, number of samples
WRITE status:
@@ -3192,7 +3194,12 @@ Split up, the format is as follows:
Completion latency: min, max, mean, stdev (usec)
Completion latency percentiles: 20 fields (see below)
Total latency: min, max, mean, stdev (usec)
- Bw (KiB/s): min, max, aggregate percentage of total, mean, stdev
+ Bw (KiB/s): min, max, aggregate percentage of total, mean, stdev, number of samples [v5]
+ IOPS [v5]: min, max, mean, stdev, number of samples
+
+ TRIM status [all but version 3]:
+
+ Fields are similar to READ/WRITE status.
CPU usage::
@@ -3210,7 +3217,7 @@ Split up, the format is as follows:
<=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000, 2000, >=2000
- Disk utilization::
+ Disk utilization [v3]::
Disk name, Read ios, write ios,
Read merges, write merges,
diff --git a/fio.1 b/fio.1
index 96eceafb..6a6ea1b2 100644
--- a/fio.1
+++ b/fio.1
@@ -43,7 +43,7 @@ Deprecated, use \-\-output-format instead to select multiple formats.
Display version information and exit.
.TP
.BI \-\-terse\-version \fR=\fPversion
-Set terse version output format (default 3, or 2 or 4)
+Set terse version output format (default 3, or 2, 4, 5)
.TP
.B \-\-help
Display usage information and exit.
@@ -2161,10 +2161,11 @@ scripted use.
A job description (if provided) follows on a new line. Note that the first
number in the line is the version number. If the output has to be changed
for some reason, this number will be incremented by 1 to signify that
-change. The fields are:
+change. Numbers in brackets (e.g. "[v3]") indicate which terse version
+introduced a field. The fields are:
.P
.RS
-.B terse version, fio version, jobname, groupid, error
+.B terse version, fio version [v3], jobname, groupid, error
.P
Read status:
.RS
@@ -2188,7 +2189,11 @@ Total latency:
.RE
Bandwidth:
.RS
-.B min, max, aggregate percentage of total, mean, standard deviation
+.B min, max, aggregate percentage of total, mean, standard deviation, number of samples [v5]
+.RE
+IOPS [v5]:
+.RS
+.B min, max, mean, standard deviation, number of samples
.RE
.RE
.P
@@ -2214,10 +2219,19 @@ Total latency:
.RE
Bandwidth:
.RS
-.B min, max, aggregate percentage of total, mean, standard deviation
+.B min, max, aggregate percentage of total, mean, standard deviation, number of samples [v5]
+.RE
+IOPS [v5]:
+.RS
+.B min, max, mean, standard deviation, number of samples
.RE
.RE
.P
+Trim status [all but version 3]:
+.RS
+Similar to Read/Write status but for trims.
+.RE
+.P
CPU usage:
.RS
.B user, system, context switches, major page faults, minor page faults
@@ -2240,7 +2254,7 @@ Milliseconds:
.RE
.RE
.P
-Disk utilization (1 for each disk used):
+Disk utilization (1 for each disk used) [v3]:
.RS
.B name, read ios, write ios, read merges, write merges, read ticks, write ticks, read in-queue time, write in-queue time, disk utilization percentage
.RE
diff --git a/init.c b/init.c
index b8e97f09..2cf47d31 100644
--- a/init.c
+++ b/init.c
@@ -2404,8 +2404,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
break;
case 'V':
terse_version = atoi(optarg);
- if (!(terse_version == 2 || terse_version == 3 ||
- terse_version == 4)) {
+ if (!(terse_version >= 2 && terse_version <= 5)) {
log_err("fio: bad terse version format\n");
exit_val = 1;
do_exit++;
diff --git a/stat.c b/stat.c
index 1201c35c..b3b2cb35 100644
--- a/stat.c
+++ b/stat.c
@@ -863,13 +863,13 @@ static void show_thread_status_normal(struct thread_stat *ts,
static void show_ddir_status_terse(struct thread_stat *ts,
struct group_run_stats *rs, int ddir,
- struct buf_output *out)
+ int ver, struct buf_output *out)
{
unsigned long long min, max, minv, maxv, bw, iops;
unsigned long long *ovals = NULL;
double mean, dev;
unsigned int len;
- int i;
+ int i, bw_stat;
assert(ddir_rw(ddir));
@@ -919,7 +919,8 @@ static void show_ddir_status_terse(struct thread_stat *ts,
if (ovals)
free(ovals);
- if (calc_lat(&ts->bw_stat[ddir], &min, &max, &mean, &dev)) {
+ bw_stat = calc_lat(&ts->bw_stat[ddir], &min, &max, &mean, &dev);
+ if (bw_stat) {
double p_of_agg = 100.0;
if (rs->agg[ddir]) {
@@ -931,6 +932,19 @@ static void show_ddir_status_terse(struct thread_stat *ts,
log_buf(out, ";%llu;%llu;%f%%;%f;%f", min, max, p_of_agg, mean, dev);
} else
log_buf(out, ";%llu;%llu;%f%%;%f;%f", 0ULL, 0ULL, 0.0, 0.0, 0.0);
+
+ if (ver == 5) {
+ if (bw_stat)
+ log_buf(out, ";%lu", (&ts->bw_stat[ddir])->samples);
+ else
+ log_buf(out, ";%lu", 0UL);
+
+ if (calc_lat(&ts->iops_stat[ddir], &min, &max, &mean, &dev))
+ log_buf(out, ";%llu;%llu;%f;%f;%lu", min, max,
+ mean, dev, (&ts->iops_stat[ddir])->samples);
+ else
+ log_buf(out, ";%llu;%llu;%f;%f;%lu", 0ULL, 0ULL, 0.0, 0.0, 0UL);
+ }
}
static void add_ddir_status_json(struct thread_stat *ts,
@@ -1087,12 +1101,12 @@ static void show_thread_status_terse_all(struct thread_stat *ts,
ts->name, ts->groupid, ts->error);
/* Log Read Status */
- show_ddir_status_terse(ts, rs, DDIR_READ, out);
+ show_ddir_status_terse(ts, rs, DDIR_READ, ver, out);
/* Log Write Status */
- show_ddir_status_terse(ts, rs, DDIR_WRITE, out);
+ show_ddir_status_terse(ts, rs, DDIR_WRITE, ver, out);
/* Log Trim Status */
- if (ver == 2 || ver == 4)
- show_ddir_status_terse(ts, rs, DDIR_TRIM, out);
+ if (ver == 2 || ver == 4 || ver == 5)
+ show_ddir_status_terse(ts, rs, DDIR_TRIM, ver, out);
/* CPU Usage */
if (ts->total_run_time) {
@@ -1376,7 +1390,7 @@ static void show_thread_status_terse(struct thread_stat *ts,
struct group_run_stats *rs,
struct buf_output *out)
{
- if (terse_version >= 2 && terse_version <= 4)
+ if (terse_version >= 2 && terse_version <= 5)
show_thread_status_terse_all(ts, rs, terse_version, out);
else
log_err("fio: bad terse version!? %d\n", terse_version);
--
2.12.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v4 0/4] stat: Modify info for bw and add iops stats
2017-06-23 22:27 [PATCH v4 0/4] stat: Modify info for bw and add iops stats Andreas Herrmann
` (3 preceding siblings ...)
2017-06-23 22:27 ` [PATCH 4/4] stat: Add iops stat and sample number information to terse format Andreas Herrmann
@ 2017-06-23 22:31 ` Jens Axboe
4 siblings, 0 replies; 11+ messages in thread
From: Jens Axboe @ 2017-06-23 22:31 UTC (permalink / raw)
To: Andreas Herrmann; +Cc: fio
On 06/23/2017 04:27 PM, Andreas Herrmann wrote:
> Hi,
>
> Next try. Changes to previous version:
>
> [PATCH 1/4] stat: Print one-line iops stat
> - Added client conversion and bump server version
> [PATCH 2/4] stat: Print number of samples in bw and iops stats
> [PATCH 3/4] stat: Merge show_thread_status_terse_* functions
> [PATCH 4/4] stat: Add iops stat and sample number information to
> - Added explanation of v5 terse format to man page and HOWTO
> - Continue to report TRIM status with terse version 5
Thanks, applied!
> One oddity I've spotted is that man page states
>
> "text description (if provided in config - appears on newline)"
>
> But I think that this applies only to v2 terse format.
>
> My merge of the terse output functions tried to preserve the code as
> is so no newline for v3 and above.
>
> If the newline is the desired behaviour I'll send a follow-on patch to
> adapt the code to the man-page (and if not vice versa).
Only for v2, so I think you're fine.
--
Jens Axboe
^ permalink raw reply [flat|nested] 11+ messages in thread