if (!track_ios)
return;
- iot = __find_track(pdi, t->sector + (t->bytes >> 9));
+ iot = __find_track(pdi, t->sector + t_sec(t));
if (!iot) {
fprintf(stderr, "merge not found for (%d,%d): %llu\n",
MAJOR(pdi->dev), MINOR(pdi->dev),
- (unsigned long long) t->sector + (t->bytes >> 9));
+ (unsigned long long) t->sector + t_sec(t));
return;
}
rb_erase(&iot->rb_node, &pdi->rb_track);
- iot->sector -= t->bytes >> 9;
+ iot->sector -= t_sec(t);
track_rb_insert(pdi, iot);
}
{
if (rw) {
ios->mwrites++;
- ios->qwrite_kb += t->bytes >> 10;
+ ios->qwrite_kb += t_kb(t);
} else {
ios->mreads++;
- ios->qread_kb += t->bytes >> 10;
+ ios->qread_kb += t_kb(t);
}
}
{
if (rw) {
ios->qwrites++;
- ios->qwrite_kb += t->bytes >> 10;
+ ios->qwrite_kb += t_kb(t);
} else {
ios->qreads++;
- ios->qread_kb += t->bytes >> 10;
+ ios->qread_kb += t_kb(t);
}
}
fprintf(ofp, strcat(format, "d"), MINOR(t->device));
break;
case 'n':
- fprintf(ofp, strcat(format, "u"), t->bytes >> 9);
+ fprintf(ofp, strcat(format, "u"), t_sec(t));
break;
case 'N':
fprintf(ofp, strcat(format, "u"), t->bytes);
if (elapsed != -1ULL) {
fprintf(ofp, "%llu + %u (%8llu) [%d]\n",
(unsigned long long) t->sector,
- t->bytes >> 9, elapsed, t->error);
+ t_sec(t), elapsed, t->error);
} else {
fprintf(ofp, "%llu + %u [%d]\n",
(unsigned long long) t->sector,
- t->bytes >> 9, t->error);
+ t_sec(t), t->error);
}
}
break;
if (elapsed != -1ULL) {
fprintf(ofp, "%llu + %u (%8llu) [%s]\n",
(unsigned long long) t->sector,
- t->bytes >> 9, elapsed, t->comm);
+ t_sec(t), elapsed, t->comm);
} else {
fprintf(ofp, "%llu + %u [%s]\n",
(unsigned long long) t->sector,
- t->bytes >> 9, t->comm);
+ t_sec(t), t->comm);
}
}
break;
case 'G': /* Get request */
case 'S': /* Sleep request */
fprintf(ofp, "%llu + %u [%s]\n", (unsigned long long) t->sector,
- t->bytes >> 9, t->comm);
+ t_sec(t), t->comm);
break;
case 'P': /* Plug */
get_pdu_remap(t, &r);
fprintf(ofp, "%llu + %u <- (%d,%d) %llu\n",
- (unsigned long long) r.sector, t->bytes >> 10,
+ (unsigned long long) r.sector, t_sec(t),
MAJOR(r.device), MINOR(r.device),
(unsigned long long) t->sector);
break;