Add statistics and make scsictl accept generic key/value parameters (#1237/#1238) (#1262)

* Add statistics and make scsictl accept generic key/value parameters
This commit is contained in:
Uwe Seimet
2023-10-30 13:32:45 +01:00
committed by GitHub
parent 8f45e4f491
commit b7cb23e391
26 changed files with 557 additions and 105 deletions
+6 -2
View File
@@ -48,7 +48,7 @@ void DiskTrack::Init(int track, int size, int sectors, bool raw, off_t imgoff)
dt.imgoffset = imgoff;
}
bool DiskTrack::Load(const string& path)
bool DiskTrack::Load(const string& path, uint64_t& cache_miss_read_count)
{
// Not needed if already loaded
if (dt.init) {
@@ -56,6 +56,8 @@ bool DiskTrack::Load(const string& path)
return true;
}
++cache_miss_read_count;
// Calculate offset (previous tracks are considered to hold 256 sectors)
off_t offset = ((off_t)dt.track << 8);
if (dt.raw) {
@@ -138,7 +140,7 @@ bool DiskTrack::Load(const string& path)
return true;
}
bool DiskTrack::Save(const string& path)
bool DiskTrack::Save(const string& path, uint64_t& cache_miss_write_count)
{
// Not needed if not initialized
if (!dt.init) {
@@ -150,6 +152,8 @@ bool DiskTrack::Save(const string& path)
return true;
}
++cache_miss_write_count;
// Need to write
assert(dt.buffer);
assert((dt.sectors > 0) && (dt.sectors <= 0x100));