Move some of the trace entries around so that we know the page(s) they concern

and add that info to the trace entries.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43187 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2011-11-04 18:01:15 +00:00
parent 2f4f7479b0
commit 6d41dfd95c
+22 -13
View File
@@ -275,26 +275,31 @@ private:
class AllocatePage class AllocatePage
: public TRACE_ENTRY_SELECTOR(PAGE_ALLOCATION_TRACING_STACK_TRACE) { : public TRACE_ENTRY_SELECTOR(PAGE_ALLOCATION_TRACING_STACK_TRACE) {
public: public:
AllocatePage() AllocatePage(page_num_t pageNumber)
: :
TraceEntryBase(PAGE_ALLOCATION_TRACING_STACK_TRACE, 0, true) TraceEntryBase(PAGE_ALLOCATION_TRACING_STACK_TRACE, 0, true),
fPageNumber(pageNumber)
{ {
Initialized(); Initialized();
} }
virtual void AddDump(TraceOutput& out) virtual void AddDump(TraceOutput& out)
{ {
out.Print("page alloc"); out.Print("page alloc: %#" B_PRIxPHYSADDR, fPageNumber);
} }
private:
page_num_t fPageNumber;
}; };
class AllocatePageRun class AllocatePageRun
: public TRACE_ENTRY_SELECTOR(PAGE_ALLOCATION_TRACING_STACK_TRACE) { : public TRACE_ENTRY_SELECTOR(PAGE_ALLOCATION_TRACING_STACK_TRACE) {
public: public:
AllocatePageRun(uint32 length) AllocatePageRun(page_num_t startPage, uint32 length)
: :
TraceEntryBase(PAGE_ALLOCATION_TRACING_STACK_TRACE, 0, true), TraceEntryBase(PAGE_ALLOCATION_TRACING_STACK_TRACE, 0, true),
fStartPage(startPage),
fLength(length) fLength(length)
{ {
Initialized(); Initialized();
@@ -302,10 +307,12 @@ public:
virtual void AddDump(TraceOutput& out) virtual void AddDump(TraceOutput& out)
{ {
out.Print("page alloc run: length: %ld", fLength); out.Print("page alloc run: start %#" B_PRIxPHYSADDR " length: %"
B_PRIu32, fStartPage, fLength);
} }
private: private:
page_num_t fStartPage;
uint32 fLength; uint32 fLength;
}; };
@@ -313,17 +320,21 @@ private:
class FreePage class FreePage
: public TRACE_ENTRY_SELECTOR(PAGE_ALLOCATION_TRACING_STACK_TRACE) { : public TRACE_ENTRY_SELECTOR(PAGE_ALLOCATION_TRACING_STACK_TRACE) {
public: public:
FreePage() FreePage(page_num_t pageNumber)
: :
TraceEntryBase(PAGE_ALLOCATION_TRACING_STACK_TRACE, 0, true) TraceEntryBase(PAGE_ALLOCATION_TRACING_STACK_TRACE, 0, true),
fPageNumber(pageNumber)
{ {
Initialized(); Initialized();
} }
virtual void AddDump(TraceOutput& out) virtual void AddDump(TraceOutput& out)
{ {
out.Print("page free"); out.Print("page free: %#" B_PRIxPHYSADDR, fPageNumber);
} }
private:
page_num_t fPageNumber;
}; };
@@ -1165,7 +1176,7 @@ free_page(vm_page* page, bool clear)
if (fromQueue != NULL) if (fromQueue != NULL)
fromQueue->RemoveUnlocked(page); fromQueue->RemoveUnlocked(page);
TA(FreePage()); TA(FreePage(page->physical_page_number));
ReadLocker locker(sFreePageQueuesLock); ReadLocker locker(sFreePageQueuesLock);
@@ -3127,8 +3138,6 @@ vm_page_allocate_page(vm_page_reservation* reservation, uint32 flags)
otherQueue = &sClearPageQueue; otherQueue = &sClearPageQueue;
} }
TA(AllocatePage());
ReadLocker locker(sFreePageQueuesLock); ReadLocker locker(sFreePageQueuesLock);
vm_page* page = queue->RemoveHeadUnlocked(); vm_page* page = queue->RemoveHeadUnlocked();
@@ -3180,6 +3189,7 @@ vm_page_allocate_page(vm_page_reservation* reservation, uint32 flags)
if ((flags & VM_PAGE_ALLOC_CLEAR) != 0 && oldPageState != PAGE_STATE_CLEAR) if ((flags & VM_PAGE_ALLOC_CLEAR) != 0 && oldPageState != PAGE_STATE_CLEAR)
clear_page(page); clear_page(page);
TA(AllocatePage(page->physical_page_number));
return page; return page;
} }
@@ -3233,8 +3243,6 @@ allocate_page_run(page_num_t start, page_num_t length, uint32 flags,
ASSERT(pageState != PAGE_STATE_CLEAR); ASSERT(pageState != PAGE_STATE_CLEAR);
ASSERT(start + length <= sNumPages); ASSERT(start + length <= sNumPages);
TA(AllocatePageRun(length));
// Pull the free/clear pages out of their respective queues. Cached pages // Pull the free/clear pages out of their respective queues. Cached pages
// are allocated later. // are allocated later.
page_num_t cachedPages = 0; page_num_t cachedPages = 0;
@@ -3359,6 +3367,7 @@ allocate_page_run(page_num_t start, page_num_t length, uint32 flags,
// Note: We don't unreserve the pages since we pulled them out of the // Note: We don't unreserve the pages since we pulled them out of the
// free/clear queues without adjusting sUnreservedFreePages. // free/clear queues without adjusting sUnreservedFreePages.
TA(AllocatePageRun(start, length));
return length; return length;
} }