Calculate the distribution of io depths for the job run.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
clat (msec): min= 0, max= 631, avg=48.50, stdev=86.82
bw (KiB/s) : min= 0, max= 1196, per=51.00%, avg=664.02, stdev=681.68
cpu : usr=1.49%, sys=0.25%, ctx=7969
+ IO depths : 1=0.1%, 2=0.3%, 4=0.5%, 8=99.0%, 16=0.0%, 32=0.0%, >32=0.0%
The client number is printed, along with the group id and error of that
thread. Below is the io statistics, here for writes. In the order listed,
same disk, since they are then competing for disk access.
cpu= CPU usage. User and system time, along with the number
of context switches this thread went through.
+IO depths= The distribution of io depths over the job life time. The
+ numbers are divided into powers of 2, so for example the
+ 16= entries includes depths up to that value but higher
+ than the previous entry. In other words, it covers the
+ range from 16 to 31.
After each client has been listed, the group statistics are printed. They
will look like this:
unsigned int unlink;
};
+/*
+ * How many depth levels to log
+ */
+#define FIO_IO_U_MAP_NR 8
+
/*
* This describes a single thread/process executing a fio job.
*/
* Current IO depth and list of free and busy io_u's.
*/
unsigned int cur_depth;
+ unsigned int io_u_map[FIO_IO_U_MAP_NR];
+ unsigned long total_io_u;
struct list_head io_u_freelist;
struct list_head io_u_busylist;
return 1;
}
+static void io_u_mark_depth(struct thread_data *td)
+{
+ int index = 0;
+
+ switch (td->cur_depth) {
+ default:
+ index++;
+ case 32 ... 63:
+ index++;
+ case 16 ... 31:
+ index++;
+ case 8 ... 15:
+ index++;
+ case 4 ... 7:
+ index++;
+ case 2 ... 3:
+ index++;
+ case 1:
+ break;
+ }
+
+ td->io_u_map[index]++;
+ td->total_io_u++;
+}
+
struct io_u *__get_io_u(struct thread_data *td)
{
struct io_u *io_u = NULL;
list_del(&io_u->list);
list_add(&io_u->list, &td->io_u_busylist);
td->cur_depth++;
+ io_u_mark_depth(td);
}
return io_u;
{
double usr_cpu, sys_cpu;
unsigned long runtime;
+ double io_u_dist[FIO_IO_U_MAP_NR];
+ int i;
if (!(td->io_bytes[0] + td->io_bytes[1]) && !td->error)
return;
}
fprintf(f_out, " cpu : usr=%3.2f%%, sys=%3.2f%%, ctx=%lu\n", usr_cpu, sys_cpu, td->ctx);
+
+ /*
+ * Do depth distribution calculations
+ */
+ for (i = 0; i < FIO_IO_U_MAP_NR; i++) {
+ io_u_dist[i] = (double) td->io_u_map[i] / (double) td->total_io_u;
+ io_u_dist[i] *= 100.0;
+ }
+
+ fprintf(f_out, " IO depths : 1=%3.1f%%, 2=%3.1f%%, 4=%3.1f%%, 8=%3.1f%%, 16=%3.1f%%, 32=%3.1f%%, >32=%3.1f%%\n", 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]);
}
static void show_ddir_status_terse(struct thread_data *td,