Skip to content
Snippets Groups Projects
Commit 6a6d7a60 authored by Pascal Pieper's avatar Pascal Pieper
Browse files

Added debug functions

parent 3beba59e
No related branches found
No related tags found
No related merge requests found
......@@ -244,4 +244,11 @@ public:
const char* f_getLastError(){
return err_msg(fs->getLastErr());
}
Paffs*
getPaffs()
{
printf("WARNING: This is for debug purposes only!\n");
return fs;
}
};
......@@ -95,6 +95,29 @@ public:
ofstream es(filesizefil, ios::out | ios::binary);
es.write(reinterpret_cast<char*>(&filesizeBackup), sizeof(unsigned int) * numberOfFiles);
es.close();
//FIXME DEBUG
//debug
printf("\n\nDEBUG: sumCache prePowerloss\n");
static_cast<paffs_IF*>(fsif)->getPaffs()->getDevice(0)->sumCache.printStatus();
AreaManagement* areaMgmt = &static_cast<paffs_IF*>(fsif)->getPaffs()->getDevice(0)->areaMgmt;
printf("Info: \n\t%" PTYPE_AREAPOS " used Areas\n", areaMgmt->getUsedAreas());
for (AreaPos i = 0; i < areasNo; i++)
{
printf("\tArea %3" PTYPE_AREAPOS " on %4" PTYPE_AREAPOS " as %10s %s\n",
i,
areaMgmt->getPos(i),
areaNames[areaMgmt->getType(i)],
areaStatusNames[areaMgmt->getStatus(i)]);
if (i > 128)
{
printf("\n -- truncated 128-%" PTYPE_AREAPOS " Areas.\n", areasNo);
break;
}
}
printf("\t----------------------\n");
//FIXME DEBUG
}
}
......@@ -281,6 +304,7 @@ public:
ins.close();
TraceMask bkp = traceMask;
traceMask = (traceMask & ~PAFFS_WRITE_VERIFY_AS) |
PAFFS_TRACE_AREA |
PAFFS_TRACE_JOURNAL |
PAFFS_TRACE_ASCACHE |
PAFFS_TRACE_PACACHE |
......@@ -289,11 +313,11 @@ public:
fsif->mount();
traceMask = bkp;
}
}
}
while(true)
{
enableCallback();
while(true)
{
enableCallback();
while(!exitAndRedo)
{
if(appendOrDeleteFile(accesses++ % numberOfFiles) < 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment