From c2ba050d2e5638774571ea0ad0375a1c17c7b04e Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Fri, 17 Dec 2010 14:21:17 -0800 Subject: xen/trace: add ptpage alloc/release tracepoints Signed-off-by: Jeremy Fitzhardinge --- arch/x86/xen/mmu.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'arch/x86/xen') diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 43fa7771ccb..f2160997287 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -1478,8 +1478,11 @@ static void __init xen_release_pmd_init(unsigned long pfn) static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned level) { struct page *page = pfn_to_page(pfn); + int pinned = PagePinned(virt_to_page(mm->pgd)); + + trace_xen_mmu_alloc_ptpage(mm, pfn, level, pinned); - if (PagePinned(virt_to_page(mm->pgd))) { + if (pinned) { SetPagePinned(page); if (!PageHighMem(page)) { @@ -1508,8 +1511,11 @@ static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn) static void xen_release_ptpage(unsigned long pfn, unsigned level) { struct page *page = pfn_to_page(pfn); + bool pinned = PagePinned(page); - if (PagePinned(page)) { + trace_xen_mmu_release_ptpage(pfn, level, pinned); + + if (pinned) { if (!PageHighMem(page)) { if (level == PT_PTE && USE_SPLIT_PTLOCKS) pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn); -- cgit v1.2.3-70-g09d2