12 static struct itimerval itimer;
13 static struct list_head disk_list = LIST_HEAD_INIT(disk_list);
14 static int last_majdev, last_mindev;
17 * Cheesy number->string conversion, complete with carry rounding error.
19 static char *num2str(unsigned long num, int maxlen, int base, int pow2)
21 char postfix[] = { ' ', 'K', 'M', 'G', 'P', 'E' };
22 unsigned int thousand;
33 for (i = 0; base > 1; i++)
39 len = sprintf(buf, "%'lu", num);
42 buf[len] = postfix[i];
48 if ((num % thousand) >= (thousand / 2))
59 static int get_io_ticks(struct disk_util *du, struct disk_util_stat *dus)
66 f = fopen(du->path, "r");
70 p = fgets(line, sizeof(line), f);
76 if (sscanf(p, "%u %u %llu %u %u %u %llu %u %u %u %u\n", &dus->ios[0], &dus->merges[0], &dus->sectors[0], &dus->ticks[0], &dus->ios[1], &dus->merges[1], &dus->sectors[1], &dus->ticks[1], &in_flight, &dus->io_ticks, &dus->time_in_queue) != 11) {
85 static void update_io_tick_disk(struct disk_util *du)
87 struct disk_util_stat __dus, *dus, *ldus;
90 if (get_io_ticks(du, &__dus))
96 dus->sectors[0] += (__dus.sectors[0] - ldus->sectors[0]);
97 dus->sectors[1] += (__dus.sectors[1] - ldus->sectors[1]);
98 dus->ios[0] += (__dus.ios[0] - ldus->ios[0]);
99 dus->ios[1] += (__dus.ios[1] - ldus->ios[1]);
100 dus->merges[0] += (__dus.merges[0] - ldus->merges[0]);
101 dus->merges[1] += (__dus.merges[1] - ldus->merges[1]);
102 dus->ticks[0] += (__dus.ticks[0] - ldus->ticks[0]);
103 dus->ticks[1] += (__dus.ticks[1] - ldus->ticks[1]);
104 dus->io_ticks += (__dus.io_ticks - ldus->io_ticks);
105 dus->time_in_queue += (__dus.time_in_queue - ldus->time_in_queue);
107 fio_gettime(&t, NULL);
108 du->msec += mtime_since(&du->time, &t);
109 memcpy(&du->time, &t, sizeof(t));
110 memcpy(ldus, &__dus, sizeof(__dus));
113 void update_io_ticks(void)
115 struct list_head *entry;
116 struct disk_util *du;
118 list_for_each(entry, &disk_list) {
119 du = list_entry(entry, struct disk_util, list);
120 update_io_tick_disk(du);
124 static int disk_util_exists(int major, int minor)
126 struct list_head *entry;
127 struct disk_util *du;
129 list_for_each(entry, &disk_list) {
130 du = list_entry(entry, struct disk_util, list);
132 if (major == du->major && minor == du->minor)
139 static void disk_util_add(int majdev, int mindev, char *path)
141 struct disk_util *du, *__du;
142 struct list_head *entry;
144 du = malloc(sizeof(*du));
145 memset(du, 0, sizeof(*du));
146 INIT_LIST_HEAD(&du->list);
147 sprintf(du->path, "%s/stat", path);
148 du->name = strdup(basename(path));
152 list_for_each(entry, &disk_list) {
153 __du = list_entry(entry, struct disk_util, list);
155 if (!strcmp(du->name, __du->name)) {
162 fio_gettime(&du->time, NULL);
163 get_io_ticks(du, &du->last_dus);
165 list_add_tail(&du->list, &disk_list);
168 static int check_dev_match(int majdev, int mindev, char *path)
174 f = fopen(path, "r");
180 p = fgets(line, sizeof(line), f);
186 if (sscanf(p, "%u:%u", &major, &minor) != 2) {
191 if (majdev == major && mindev == minor) {
200 static int find_block_dir(int majdev, int mindev, char *path)
211 while ((dir = readdir(D)) != NULL) {
214 if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
217 sprintf(full_path, "%s/%s", path, dir->d_name);
219 if (!strcmp(dir->d_name, "dev")) {
220 if (!check_dev_match(majdev, mindev, full_path)) {
226 if (lstat(full_path, &st) == -1) {
231 if (!S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))
234 found = find_block_dir(majdev, mindev, full_path);
236 strcpy(path, full_path);
245 static void __init_disk_util(struct thread_data *td, struct fio_file *f)
248 char foo[PATH_MAX], tmp[PATH_MAX];
252 if (!stat(f->file_name, &st)) {
253 if (S_ISBLK(st.st_mode)) {
254 majdev = major(st.st_rdev);
255 mindev = minor(st.st_rdev);
256 } else if (S_ISCHR(st.st_mode)) {
257 majdev = major(st.st_rdev);
258 mindev = minor(st.st_rdev);
259 fio_lookup_raw(st.st_rdev, &majdev, &mindev);
261 majdev = major(st.st_dev);
262 mindev = minor(st.st_dev);
266 * must be a file, open "." in that path
268 strncpy(foo, f->file_name, PATH_MAX - 1);
271 perror("disk util stat");
275 majdev = major(st.st_dev);
276 mindev = minor(st.st_dev);
279 if (disk_util_exists(majdev, mindev))
283 * for an fs without a device, we will repeatedly stat through
284 * sysfs which can take oodles of time for thousands of files. so
285 * cache the last lookup and compare with that before going through
288 if (mindev == last_mindev && majdev == last_majdev)
291 last_mindev = mindev;
292 last_majdev = majdev;
294 sprintf(foo, "/sys/block");
295 if (!find_block_dir(majdev, mindev, foo))
299 * If there's a ../queue/ directory there, we are inside a partition.
300 * Check if that is the case and jump back. For loop/md/dm etc we
301 * are already in the right spot.
303 sprintf(tmp, "%s/../queue", foo);
304 if (!stat(tmp, &st)) {
306 sprintf(tmp, "%s/queue", p);
307 if (stat(tmp, &st)) {
308 log_err("unknown sysfs layout\n");
311 strncpy(tmp, p, PATH_MAX - 1);
312 sprintf(foo, "%s", tmp);
315 if (td->o.ioscheduler && !td->sysfs_root)
316 td->sysfs_root = strdup(foo);
318 disk_util_add(majdev, mindev, foo);
321 void init_disk_util(struct thread_data *td)
326 if (!td->o.do_disk_util ||
327 (td->io_ops->flags & (FIO_DISKLESSIO | FIO_NODISKUTIL)))
330 for_each_file(td, f, i)
331 __init_disk_util(td, f);
334 void disk_util_timer_arm(void)
336 itimer.it_value.tv_sec = 0;
337 itimer.it_value.tv_usec = DISK_UTIL_MSEC * 1000;
338 setitimer(ITIMER_REAL, &itimer, NULL);
341 void update_rusage_stat(struct thread_data *td)
343 struct thread_stat *ts = &td->ts;
345 getrusage(RUSAGE_SELF, &ts->ru_end);
347 ts->usr_time += mtime_since(&ts->ru_start.ru_utime, &ts->ru_end.ru_utime);
348 ts->sys_time += mtime_since(&ts->ru_start.ru_stime, &ts->ru_end.ru_stime);
349 ts->ctx += ts->ru_end.ru_nvcsw + ts->ru_end.ru_nivcsw - (ts->ru_start.ru_nvcsw + ts->ru_start.ru_nivcsw);
351 memcpy(&ts->ru_start, &ts->ru_end, sizeof(ts->ru_end));
354 static int calc_lat(struct io_stat *is, unsigned long *min, unsigned long *max,
355 double *mean, double *dev)
357 double n = is->samples;
359 if (is->samples == 0)
365 n = (double) is->samples;
369 *dev = sqrt(is->S / (n - 1.0));
376 static void show_group_stats(struct group_run_stats *rs, int id)
378 char *p1, *p2, *p3, *p4;
379 const char *ddir_str[] = { " READ", " WRITE" };
382 log_info("\nRun status group %d (all jobs):\n", id);
384 for (i = 0; i <= DDIR_WRITE; i++) {
388 p1 = num2str(rs->io_kb[i], 6, 1000, 1);
389 p2 = num2str(rs->agg[i], 6, 1000, 1);
390 p3 = num2str(rs->min_bw[i], 6, 1000, 1);
391 p4 = num2str(rs->max_bw[i], 6, 1000, 1);
393 log_info("%s: io=%siB, aggrb=%siB/s, minb=%siB/s, maxb=%siB/s, mint=%llumsec, maxt=%llumsec\n", ddir_str[i], p1, p2, p3, p4, rs->min_run[i], rs->max_run[i]);
402 static void show_disk_util(void)
404 struct disk_util_stat *dus;
405 struct list_head *entry, *next;
406 struct disk_util *du;
409 log_info("\nDisk stats (read/write):\n");
411 list_for_each(entry, &disk_list) {
412 du = list_entry(entry, struct disk_util, list);
415 util = (double) 100 * du->dus.io_ticks / (double) du->msec;
419 log_info(" %s: ios=%u/%u, merge=%u/%u, ticks=%u/%u, in_queue=%u, util=%3.2f%%\n", du->name, dus->ios[0], dus->ios[1], dus->merges[0], dus->merges[1], dus->ticks[0], dus->ticks[1], dus->time_in_queue, util);
425 list_for_each_safe(entry, next, &disk_list) {
427 du = list_entry(entry, struct disk_util, list);
433 #define ts_total_io_u(ts) \
434 ((ts)->total_io_u[0] + (ts)->total_io_u[1])
436 static void stat_calc_dist(struct thread_stat *ts, double *io_u_dist)
441 * Do depth distribution calculations
443 for (i = 0; i < FIO_IO_U_MAP_NR; i++) {
444 io_u_dist[i] = (double) ts->io_u_map[i] / (double) ts_total_io_u(ts);
445 io_u_dist[i] *= 100.0;
446 if (io_u_dist[i] < 0.1 && ts->io_u_map[i])
451 static void stat_calc_lat(struct thread_stat *ts, double *io_u_lat)
456 * Do latency distribution calculations
458 for (i = 0; i < FIO_IO_U_LAT_NR; i++) {
459 io_u_lat[i] = (double) ts->io_u_lat[i] / (double) ts_total_io_u(ts);
460 io_u_lat[i] *= 100.0;
461 if (io_u_lat[i] < 0.01 && ts->io_u_lat[i])
466 static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts,
469 const char *ddir_str[] = { "read ", "write" };
470 unsigned long min, max;
471 unsigned long long bw, iops;
473 char *io_p, *bw_p, *iops_p;
475 if (!ts->runtime[ddir])
478 bw = ts->io_bytes[ddir] / ts->runtime[ddir];
479 iops = (1000 * ts->total_io_u[ddir]) / ts->runtime[ddir];
480 io_p = num2str(ts->io_bytes[ddir] >> 10, 6, 1000, 1);
481 bw_p = num2str(bw, 6, 1000, 1);
482 iops_p = num2str(iops, 6, 1, 0);
484 log_info(" %s: io=%siB, bw=%siB/s, iops=%s, runt=%6lumsec\n", ddir_str[ddir], io_p, bw_p, iops_p, ts->runtime[ddir]);
490 if (calc_lat(&ts->slat_stat[ddir], &min, &max, &mean, &dev))
491 log_info(" slat (msec): min=%5lu, max=%5lu, avg=%5.02f, stdev=%5.02f\n", min, max, mean, dev);
493 if (calc_lat(&ts->clat_stat[ddir], &min, &max, &mean, &dev))
494 log_info(" clat (msec): min=%5lu, max=%5lu, avg=%5.02f, stdev=%5.02f\n", min, max, mean, dev);
496 if (calc_lat(&ts->bw_stat[ddir], &min, &max, &mean, &dev)) {
499 p_of_agg = mean * 100 / (double) rs->agg[ddir];
500 log_info(" bw (KiB/s) : min=%5lu, max=%5lu, per=%3.2f%%, avg=%5.02f, stdev=%5.02f\n", min, max, p_of_agg, mean, dev);
504 static void show_thread_status(struct thread_stat *ts,
505 struct group_run_stats *rs)
507 double usr_cpu, sys_cpu;
508 unsigned long runtime;
509 double io_u_dist[FIO_IO_U_MAP_NR];
510 double io_u_lat[FIO_IO_U_LAT_NR];
512 if (!(ts->io_bytes[0] + ts->io_bytes[1]))
516 log_info("%s: (groupid=%d, jobs=%d): err=%2d: pid=%d\n", ts->name, ts->groupid, ts->members, ts->error, ts->pid);
518 log_info("%s: (groupid=%d, jobs=%d): err=%2d (%s): pid=%d\n", ts->name, ts->groupid, ts->members, ts->error, ts->verror, ts->pid);
521 log_info(" Description : [%s]\n", ts->description);
523 if (ts->io_bytes[DDIR_READ])
524 show_ddir_status(rs, ts, DDIR_READ);
525 if (ts->io_bytes[DDIR_WRITE])
526 show_ddir_status(rs, ts, DDIR_WRITE);
528 runtime = ts->total_run_time;
530 double runt = (double) runtime;
532 usr_cpu = (double) ts->usr_time * 100 / runt;
533 sys_cpu = (double) ts->sys_time * 100 / runt;
539 log_info(" cpu : usr=%3.2f%%, sys=%3.2f%%, ctx=%lu\n", usr_cpu, sys_cpu, ts->ctx);
541 stat_calc_dist(ts, io_u_dist);
542 stat_calc_lat(ts, io_u_lat);
544 log_info(" 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]);
546 log_info(" lat (msec): 2=%3.2f%%, 4=%3.2f%%, 10=%3.2f%%, 20=%3.2f%%, 50=%3.2f%%, 100=%3.2f%%\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]);
547 log_info(" lat (msec): 250=%3.2f%%, 500=%3.2f%%, 750=%3.2f%%, 1000=%3.2f%%, >=2000=%3.2f%%\n", io_u_lat[6], io_u_lat[7], io_u_lat[8], io_u_lat[9], io_u_lat[10]);
550 static void show_ddir_status_terse(struct thread_stat *ts,
551 struct group_run_stats *rs, int ddir)
553 unsigned long min, max;
554 unsigned long long bw;
558 if (ts->runtime[ddir])
559 bw = ts->io_bytes[ddir] / ts->runtime[ddir];
561 log_info(";%llu;%llu;%lu", ts->io_bytes[ddir] >> 10, bw, ts->runtime[ddir]);
563 if (calc_lat(&ts->slat_stat[ddir], &min, &max, &mean, &dev))
564 log_info(";%lu;%lu;%f;%f", min, max, mean, dev);
566 log_info(";%lu;%lu;%f;%f", 0UL, 0UL, 0.0, 0.0);
568 if (calc_lat(&ts->clat_stat[ddir], &min, &max, &mean, &dev))
569 log_info(";%lu;%lu;%f;%f", min, max, mean, dev);
571 log_info(";%lu;%lu;%f;%f", 0UL, 0UL, 0.0, 0.0);
573 if (calc_lat(&ts->bw_stat[ddir], &min, &max, &mean, &dev)) {
576 p_of_agg = mean * 100 / (double) rs->agg[ddir];
577 log_info(";%lu;%lu;%f%%;%f;%f", min, max, p_of_agg, mean, dev);
579 log_info(";%lu;%lu;%f%%;%f;%f", 0UL, 0UL, 0.0, 0.0, 0.0);
583 static void show_thread_status_terse(struct thread_stat *ts,
584 struct group_run_stats *rs)
586 double io_u_dist[FIO_IO_U_MAP_NR];
587 double io_u_lat[FIO_IO_U_LAT_NR];
588 double usr_cpu, sys_cpu;
590 log_info("%s;%d;%d", ts->name, ts->groupid, ts->error);
592 show_ddir_status_terse(ts, rs, 0);
593 show_ddir_status_terse(ts, rs, 1);
595 if (ts->total_run_time) {
596 double runt = (double) ts->total_run_time;
598 usr_cpu = (double) ts->usr_time * 100 / runt;
599 sys_cpu = (double) ts->sys_time * 100 / runt;
605 log_info(";%f%%;%f%%;%lu", usr_cpu, sys_cpu, ts->ctx);
607 stat_calc_dist(ts, io_u_dist);
608 stat_calc_lat(ts, io_u_lat);
610 log_info(";%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]);
612 log_info(";%3.2f%%;%3.2f%%;%3.2f%%;%3.2f%%;%3.2f%%;%3.2f%%\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]);
613 log_info(";%3.2f%%;%3.2f%%;%3.2f%%;%3.2f%%;%3.2f%%", io_u_lat[6], io_u_lat[7], io_u_lat[8], io_u_lat[9], io_u_lat[10]);
616 log_info(";%s", ts->description);
621 static void sum_stat(struct io_stat *dst, struct io_stat *src, int nr)
625 dst->min_val = min(dst->min_val, src->min_val);
626 dst->max_val = max(dst->max_val, src->max_val);
627 dst->samples += src->samples;
630 * Needs a new method for calculating stddev, we cannot just
631 * average them we do below for nr > 1
637 mean = ((src->mean * (double) (nr - 1)) + dst->mean) / ((double) nr);
638 S = ((src->S * (double) (nr - 1)) + dst->S) / ((double) nr);
645 void show_run_stats(void)
647 struct group_run_stats *runstats, *rs;
648 struct thread_data *td;
649 struct thread_stat *threadstats, *ts;
650 int i, j, k, l, nr_ts, last_ts, idx;
652 runstats = malloc(sizeof(struct group_run_stats) * (groupid + 1));
654 for (i = 0; i < groupid + 1; i++) {
657 memset(rs, 0, sizeof(*rs));
658 rs->min_bw[0] = rs->min_run[0] = ~0UL;
659 rs->min_bw[1] = rs->min_run[1] = ~0UL;
663 * find out how many threads stats we need. if group reporting isn't
664 * enabled, it's one-per-td.
669 if (!td->o.group_reporting) {
673 if (last_ts == td->groupid)
676 last_ts = td->groupid;
680 threadstats = malloc(nr_ts * sizeof(struct thread_stat));
682 for (i = 0; i < nr_ts; i++) {
683 ts = &threadstats[i];
685 memset(ts, 0, sizeof(*ts));
686 for (j = 0; j <= DDIR_WRITE; j++) {
687 ts->clat_stat[j].min_val = -1UL;
688 ts->slat_stat[j].min_val = -1UL;
689 ts->bw_stat[j].min_val = -1UL;
698 if (idx && (!td->o.group_reporting ||
699 (td->o.group_reporting && last_ts != td->groupid))) {
704 last_ts = td->groupid;
706 ts = &threadstats[j];
711 if (ts->groupid == -1) {
713 * These are per-group shared already
715 ts->name = td->o.name;
716 ts->description = td->o.description;
717 ts->groupid = td->groupid;
720 * first pid in group, not very useful...
725 if (td->error && !ts->error) {
726 ts->error = td->error;
727 ts->verror = td->verror;
730 for (l = 0; l <= DDIR_WRITE; l++) {
731 sum_stat(&ts->clat_stat[l], &td->ts.clat_stat[l], idx);
732 sum_stat(&ts->slat_stat[l], &td->ts.slat_stat[l], idx);
733 sum_stat(&ts->bw_stat[l], &td->ts.bw_stat[l], idx);
735 ts->stat_io_bytes[l] += td->ts.stat_io_bytes[l];
736 ts->io_bytes[l] += td->ts.io_bytes[l];
738 if (ts->runtime[l] < td->ts.runtime[l])
739 ts->runtime[l] = td->ts.runtime[l];
742 ts->usr_time += td->ts.usr_time;
743 ts->sys_time += td->ts.sys_time;
744 ts->ctx += td->ts.ctx;
746 for (k = 0; k < FIO_IO_U_MAP_NR; k++)
747 ts->io_u_map[k] += td->ts.io_u_map[k];
748 for (k = 0; k < FIO_IO_U_LAT_NR; k++)
749 ts->io_u_lat[k] += td->ts.io_u_lat[k];
751 for (k = 0; k <= DDIR_WRITE; k++)
752 ts->total_io_u[k] += td->ts.total_io_u[k];
754 ts->total_run_time += td->ts.total_run_time;
757 for (i = 0; i < nr_ts; i++) {
758 unsigned long long bw;
760 ts = &threadstats[i];
761 rs = &runstats[ts->groupid];
763 for (j = 0; j <= DDIR_WRITE; j++) {
766 if (ts->runtime[j] < rs->min_run[j] || !rs->min_run[j])
767 rs->min_run[j] = ts->runtime[j];
768 if (ts->runtime[j] > rs->max_run[j])
769 rs->max_run[j] = ts->runtime[j];
773 bw = ts->io_bytes[j] / (unsigned long long) ts->runtime[j];
774 if (bw < rs->min_bw[j])
776 if (bw > rs->max_bw[j])
779 rs->io_kb[j] += ts->io_bytes[j] >> 10;
783 for (i = 0; i < groupid + 1; i++) {
787 rs->agg[0] = (rs->io_kb[0]*1024) / rs->max_run[0];
789 rs->agg[1] = (rs->io_kb[1]*1024) / rs->max_run[1];
793 * don't overwrite last signal output
798 for (i = 0; i < nr_ts; i++) {
799 ts = &threadstats[i];
800 rs = &runstats[ts->groupid];
803 show_thread_status_terse(ts, rs);
805 show_thread_status(ts, rs);
809 for (i = 0; i < groupid + 1; i++)
810 show_group_stats(&runstats[i], i);
819 static inline void add_stat_sample(struct io_stat *is, unsigned long data)
824 if (data > is->max_val)
826 if (data < is->min_val)
829 delta = val - is->mean;
831 is->mean += delta / (is->samples + 1.0);
832 is->S += delta * (val - is->mean);
838 static void __add_log_sample(struct io_log *iolog, unsigned long val,
839 enum fio_ddir ddir, unsigned long time)
841 if (iolog->nr_samples == iolog->max_samples) {
842 int new_size = sizeof(struct io_sample) * iolog->max_samples*2;
844 iolog->log = realloc(iolog->log, new_size);
845 iolog->max_samples <<= 1;
848 iolog->log[iolog->nr_samples].val = val;
849 iolog->log[iolog->nr_samples].time = time;
850 iolog->log[iolog->nr_samples].ddir = ddir;
854 static void add_log_sample(struct thread_data *td, struct io_log *iolog,
855 unsigned long val, enum fio_ddir ddir)
857 __add_log_sample(iolog, val, ddir, mtime_since_now(&td->epoch));
860 void add_agg_sample(unsigned long val, enum fio_ddir ddir)
862 struct io_log *iolog = agg_io_log[ddir];
864 __add_log_sample(iolog, val, ddir, mtime_since_genesis());
867 void add_clat_sample(struct thread_data *td, enum fio_ddir ddir,
870 struct thread_stat *ts = &td->ts;
872 add_stat_sample(&ts->clat_stat[ddir], msec);
875 add_log_sample(td, ts->clat_log, msec, ddir);
878 void add_slat_sample(struct thread_data *td, enum fio_ddir ddir,
881 struct thread_stat *ts = &td->ts;
883 add_stat_sample(&ts->slat_stat[ddir], msec);
886 add_log_sample(td, ts->slat_log, msec, ddir);
889 void add_bw_sample(struct thread_data *td, enum fio_ddir ddir,
892 struct thread_stat *ts = &td->ts;
893 unsigned long spent = mtime_since(&ts->stat_sample_time[ddir], t);
896 if (spent < td->o.bw_avg_time)
899 rate = (td->this_io_bytes[ddir] - ts->stat_io_bytes[ddir]) / spent;
900 add_stat_sample(&ts->bw_stat[ddir], rate);
903 add_log_sample(td, ts->bw_log, rate, ddir);
905 fio_gettime(&ts->stat_sample_time[ddir], NULL);
906 ts->stat_io_bytes[ddir] = td->this_io_bytes[ddir];