Print some more interesting timing info for the page writer.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27245 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-08-30 22:50:44 +00:00
parent 4352fc9187
commit fd49e6b35a

View File

@ -1137,6 +1137,8 @@ page_writer(void* /*unused*/)
const uint32 kNumPages = 256;
uint32 writtenPages = 0;
bigtime_t lastWrittenTime = 0;
bigtime_t pageCollectionTime = 0;
bigtime_t pageWritingTime = 0;
PageWriterRun run;
if (run.Init(kNumPages) != B_OK) {
@ -1173,6 +1175,8 @@ page_writer(void* /*unused*/)
!= B_NO_LOW_RESOURCE;
#endif
pageCollectionTime -= system_time();
while (numPages < kNumPages) {
vm_page *page = next_modified_page(marker);
if (page == NULL)
@ -1226,20 +1230,28 @@ page_writer(void* /*unused*/)
numPages++;
}
pageCollectionTime += system_time();
if (numPages == 0)
continue;
// write pages to disk and do all the cleanup
pageWritingTime -= system_time();
run.Go();
pageWritingTime += system_time();
// debug output only...
writtenPages += numPages;
if (writtenPages >= 1024) {
bigtime_t now = system_time();
dprintf("page writer: wrote 1024 pages (%llu ms)\n",
(now - lastWrittenTime) / 1000);
dprintf("page writer: wrote 1024 pages (total: %llu ms, "
"collect: %llu ms, write: %llu ms)\n",
(now - lastWrittenTime) / 1000,
pageCollectionTime / 1000, pageWritingTime / 1000);
writtenPages -= 1024;
lastWrittenTime = now;
pageCollectionTime = 0;
pageWritingTime = 0;
}
}