X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.c;h=819a7c687da448ea87ef44dd3eca9e18c17061d5;hp=fb776e9c0ecbe4c0ee5eac9c1c8660cad2b714df;hb=22819ec237297fc39435ed566bee01a4225bfb39;hpb=dbe1125e9c53b2a0b1fc2fd9c6cfd0b3fbddda8b diff --git a/stat.c b/stat.c index fb776e9c..819a7c68 100644 --- a/stat.c +++ b/stat.c @@ -21,8 +21,8 @@ static char *num2str(unsigned long num, int maxlen, int base) * could be passed in for 10^3 base, but every caller expects * 2^10 base right now. */ - const int thousand = 1024; - char postfix[] = { 'K', 'M', 'G', 'P' }; + const unsigned int thousand = 1024; + 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,12 +439,16 @@ 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]) && !td->error) + if (!(td->io_bytes[0] + td->io_bytes[1])) return; - fprintf(f_out, "%s: (groupid=%d): err=%2d: pid=%d\n",td->name, td->groupid, td->error, td->pid); + if (!td->error) + fprintf(f_out, "%s: (groupid=%d): err=%2d: pid=%d\n",td->name, td->groupid, td->error, td->pid); + else + fprintf(f_out, "%s: (groupid=%d): err=%2d (%s): pid=%d\n",td->name, td->groupid, td->error, td->verror, td->pid); show_ddir_status(td, rs, td->ddir); if (td->io_bytes[td->ddir ^ 1]) @@ -473,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); } @@ -553,11 +568,6 @@ void show_run_stats(void) for_each_td(td, i) { unsigned long long rbw, wbw; - if (td->error) { - fprintf(f_out, "%s: %s\n", td->name, td->verror); - continue; - } - rs = &runstats[td->groupid]; if (td->runtime[0] < rs->min_run[0] || !rs->min_run[0])