WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 06/15] xen/trace: add ptpage alloc/release tracep

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 06/15] xen/trace: add ptpage alloc/release tracepoints
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Tue, 21 Jun 2011 09:55:11 -0400
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Xen Devel <Xen-devel@xxxxxxxxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>
Delivery-date: Tue, 21 Jun 2011 06:56:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <a92051a41ed96ad362d1f79c7b3e36c8cc4dd80b.1308607697.git.jeremy.fitzhardinge@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <cover.1308607697.git.jeremy.fitzhardinge@xxxxxxxxxx> <a92051a41ed96ad362d1f79c7b3e36c8cc4dd80b.1308607697.git.jeremy.fitzhardinge@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jun 20, 2011 at 03:15:02PM -0700, Jeremy Fitzhardinge wrote:
> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
> 
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
> ---
>  arch/x86/xen/mmu.c         |   10 ++++++++--
>  include/trace/events/xen.h |   33 +++++++++++++++++++++++++++++++++
>  2 files changed, 41 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index 90101c5..84c796f 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -1473,8 +1473,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));

Why not use 'bool' as you
> + 

^ this above has a space right after it.
> +     trace_xen_mmu_alloc_ptpage(mm, pfn, level, pinned);
>  
> -     if (PagePinned(virt_to_page(mm->pgd))) {
> +     if (pinned) {
>               SetPagePinned(page);
>  
>               if (!PageHighMem(page)) {
> @@ -1503,8 +1506,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);

..do here?
>  
> -     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);
> diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
> index 5c4e967..16edcb7 100644
> --- a/include/trace/events/xen.h
> +++ b/include/trace/events/xen.h
> @@ -347,6 +347,39 @@ TRACE_EVENT(xen_mmu_ptep_modify_prot_commit,
>                     (int)sizeof(pteval_t) * 2, (unsigned long 
> long)__entry->pteval)
>       );
>  
> +TRACE_EVENT(xen_mmu_alloc_ptpage,
> +         TP_PROTO(struct mm_struct *mm, unsigned long pfn, unsigned level, 
> bool pinned),
> +         TP_ARGS(mm, pfn, level, pinned),
> +         TP_STRUCT__entry(
> +                 __field(struct mm_struct *, mm)
> +                 __field(unsigned long, pfn)
> +                 __field(unsigned, level)
> +                 __field(bool, pinned)
> +                 ),
> +         TP_fast_assign(__entry->mm = mm;
> +                        __entry->pfn = pfn;
> +                        __entry->level = level;
> +                        __entry->pinned = pinned),
> +         TP_printk("mm %p  pfn %lx  level %d  %spinned",
> +                   __entry->mm, __entry->pfn, __entry->level,
> +                   __entry->pinned ? "" : "un")
> +     );
> +
> +TRACE_EVENT(xen_mmu_release_ptpage,
> +         TP_PROTO(unsigned long pfn, unsigned level, bool pinned),
> +         TP_ARGS(pfn, level, pinned),
> +         TP_STRUCT__entry(
> +                 __field(unsigned long, pfn)
> +                 __field(unsigned, level)
> +                 __field(bool, pinned)
> +                 ),
> +         TP_fast_assign(__entry->pfn = pfn;
> +                        __entry->level = level;
> +                        __entry->pinned = pinned),
> +         TP_printk("pfn %lx  level %d  %spinned",
> +                   __entry->pfn, __entry->level,
> +                   __entry->pinned ? "" : "un")
> +     );
>  
>  #endif /*  _TRACE_XEN_H */
>  
> -- 
> 1.7.5.4

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel