X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.c;h=819a7c687da448ea87ef44dd3eca9e18c17061d5;hp=bfdf390bcf5fac48a791be18898a3dbfe968eeef;hb=d2d7fa53c18f1fc3fb89f3fe20df9b39986bde72;hpb=c8c51efdfb621275c23ab74b385d80702b7a30d0 diff --git a/stat.c b/stat.c index bfdf390b..819a7c68 100644 --- a/stat.c +++ b/stat.c @@ -22,7 +22,7 @@ static char *num2str(unsigned long num, int maxlen, int base) * 2^10 base right now. */ const unsigned int thousand = 1024; - char postfix[] = { 'K', 'M', 'G', 'P' }; + char postfix[] = { 'K', 'M', 'G', 'P', 'E' }; char *buf; int i; @@ -47,7 +47,7 @@ static char *num2str(unsigned long num, int maxlen, int base) num /= thousand; num += carry; i++; - } while (i <= 4); + } while (i <= 5); return buf; } @@ -439,6 +439,7 @@ static void show_thread_status(struct thread_data *td, double usr_cpu, sys_cpu; unsigned long runtime; double io_u_dist[FIO_IO_U_MAP_NR]; + double io_u_lat[FIO_IO_U_LAT_NR]; int i; if (!(td->io_bytes[0] + td->io_bytes[1])) @@ -476,6 +477,17 @@ static void show_thread_status(struct thread_data *td, fprintf(f_out, " IO depths : 1=%3.1f%%, 2=%3.1f%%, 4=%3.1f%%, 8=%3.1f%%, 16=%3.1f%%, 32=%3.1f%%, >=64=%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]); + /* + * Do latency distribution calculations + */ + for (i = 0; i < FIO_IO_U_LAT_NR; i++) { + io_u_lat[i] = (double) td->io_u_lat[i] / (double) td->total_io_u; + io_u_lat[i] *= 100.0; + } + + fprintf(f_out, " lat (msec): 2=%3.1f%%, 4=%3.1f%%, 8=%3.1f%%, 16=%3.1f%%, 32=%3.1f%%, 64=%3.1f%%, 128=%3.1f%%\n", io_u_lat[0], io_u_lat[1], io_u_lat[2], io_u_lat[3], io_u_lat[4], io_u_lat[5], io_u_lat[6]); + fprintf(f_out, " lat (msec): 256=%3.1f%%, 512=%3.1f%%, 1024=%3.1f%%, >=2048=%3.1f%%\n", io_u_lat[7], io_u_lat[8], io_u_lat[9], io_u_lat[10]); + if (td->description) fprintf(f_out, "%s\n", td->description); }