mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-26 06:18:10 +00:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user