Author: mmlr Date: 2009-10-11 18:42:21 +0200 (Sun, 11 Oct 2009) New Revision: 33521 Changeset: http://dev.haiku-os.org/changeset/33521/haiku Modified: haiku/trunk/src/add-ons/kernel/bus_managers/scsi/emulation.c Log: A disabled debug helper to visualize reads/writes and if they would have been contiguous. Was used to optimized CD boot before the alpha release. Modified: haiku/trunk/src/add-ons/kernel/bus_managers/scsi/emulation.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/scsi/emulation.c 2009-10-11 16:40:12 UTC (rev 33520) +++ haiku/trunk/src/add-ons/kernel/bus_managers/scsi/emulation.c 2009-10-11 16:42:21 UTC (rev 33521) @@ -126,6 +126,29 @@ cdb->length = B_HOST_TO_BENDIAN_INT16((uint16)cmd->length); cdb->control = cmd->control; + if (0) { + static uint32 lastLBA = 0; + static uint16 lastLength = 0; + static uint32 contigCount = 0; + static uint64 totalContig = 0; + + uint32 currentLBA = B_BENDIAN_TO_HOST_INT32(cdb->lba); + uint16 currentLength = B_BENDIAN_TO_HOST_INT16(cdb->length); + + if (lastLBA + lastLength == currentLBA) { + contigCount++; + totalContig++; + } else + contigCount = 0; + + lastLBA = currentLBA; + lastLength = currentLength; + + dprintf("scsi_read_write_6: %lld lba %ld; length: %d\n", totalContig, + B_BENDIAN_TO_HOST_INT32(cdb->lba), + B_BENDIAN_TO_HOST_INT16(cdb->length)); + } + return true; }